pzprjs icon indicating copy to clipboard operation
pzprjs copied to clipboard

start of ES6 modules: move to rollup

Open alicebob opened this issue 5 years ago • 3 comments

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.

alicebob avatar Apr 18 '20 08:04 alicebob

@robx thanks for the comments, this should be it.

alicebob avatar Apr 25 '20 08:04 alicebob

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.)

robx avatar Apr 28 '20 16:04 robx

I've pushed two fixes to master that should obviate the need for those isFreeze checks.

robx avatar Apr 28 '20 16:04 robx