Closed atoppi closed 2 years ago
We'll track here the migration of the library from CJS module to ES module. Once #1 will be merged, this branch will probably need some more work. (done)
__filename
__dirname
type: module
exports
package.json
require
import
module.exports
export
export default
browserify
rollup
bundle.sh
App
We'll track here the migration of the library from CJS module to ES module.
Once #1 will be merged, this branch will probably need some more work.(done)!!! Breaking changes !!!
How to migrate to ESM
__filename
and__dirname
globals are not defined in es modetype: module
andexports
entry point in yourpackage.json
require
call into the equivalentimport
directivemodule.exports
call into the equivalentexport
/export default
directiveChanges in the browser bundling sample
browserify
does not support esm, we switched torollup
with a bunch of plugins (checkbundle.sh
)App