Skip to content

Commit

Permalink
馃敡 Read file on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Aug 25, 2018
1 parent 6f337ac commit c261079
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ async function setupProtocol () {

try {
const filePath = path.join(ES6_PATH, req.url.replace('es6://', ''))
const fileContent = await fs.readFile(filePath.replace('.js/', '.js'))
.replace('.js/', '.js')
.replace('.js\\', '.js')

const fileContent = await fs.readFile(filePath)

cb({ mimeType: 'text/javascript', data: fileContent }) // eslint-disable-line
} catch (error) {
Expand Down

0 comments on commit c261079

Please sign in to comment.