After reading amazing article:
And then reading about each of those bundlers:
I’ve decided to go with Rollup because of native ES6 modules support and smallest bundle size. But I’m sure Webpack would be also good choice as it can handle all other assets as well.
Installation:
npm i rollup -D
npm i rollup-plugin-node-resolve rollup-plugin-terser -D
touch rollup.config.js
“rollup.config.js” can be super simple:
import resolve from 'rollup-plugin-node-resolve';
export default {
input: 'firefox_dev/dial.js',
output: {
file: 'firefox_dist/dial.js',
format: 'iife',
},
plugins: [
resolve(),
]
};
Execution with:
npx rollup -c
…totally fixed the loading time!