Simple static server middleware for express/polka/etc. that resolves npm style module imports in JavaScript files to make them available for the browser in development. Just like Polymer CLI / polyserve does. But using regular expressions instead of dragging in a whole JS parser :D
Install with npm, obviously:
npm install --save-dev es-module-devserver
Something like this:
const fs = require('fs')
const polka = require('polka')
const esModuleDevserver = require('es-module-devserver')
polka()
.use(esModuleDevserver.middleware(__dirname))
.get('/', (req, res) => {
const content = fs.readFileSync('demo.html')
return res.end(content)
})
.listen(3003)
.then(_ => console.log('Running on localhost:3003'))
Please feel free to submit pull requests!
By participating in this project you agree to follow the Contributor Code of Conduct and to release your contributions under the Unlicense.
The list of contributors is available on GitHub.
This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE
file or unlicense.org.