Replace require with import and module.export with export. Tree shaking requires ES6 module syntax and ECMAScript modules have been standardized by TC39.
Use Popups as an example. It has a very similar Webpack and test configuration and already uses ES6 imports.
Changes to M.require() / M.define() are out of scope.
Acceptance criteria
- All CommonJS require and module.exports are replaced with import and export. This includes src/, tests/, and even webpack.config.js.
- Any changes made to webpack.config.js are copied to Popups.
- No regressions to production or test code..