pzprjs
pzprjs copied to clipboard
start of ES6 modules: move to rollup
This is the minimal version of #178
The build process is still to concat the JS files (as ./dist/js/pzpr.concat.js), but this file is now a ES6 module. This concated file is then transformed for the browser via rollup. The actual code of the module didn't change. The tests do use the modern import ... from ... syntax to load data.
@robx thanks for the comments, this should be it.
Having a bit of trouble working with this. Specifically,
$ make build
[...]
npx rollup -c ./rollup.config.js
Unexpected token import
make: *** [rollup] Error 1
Any clue?
Also, we might want to keep Grunt for concatenation, since that's what gives us source maps and thus decent stack traces on test failure. (This works, when run via npx grunt concat:pzpr instead of the bundle Makefile target: https://github.com/robx/pzprjs/commit/e15d00cbcf868635db4402860e1b14edb8ebfe12.)
I've pushed two fixes to master that should obviate the need for those isFreeze checks.