I have Webpack configuration for transpiled app:
entry: {
'polyfill': './app/polyfill.js',
'lib': './app/lib.js',
'main': './app/main.js'
},
output: {
path: './bundles',
filename: '[name].js',
sourceMapFilename: '[name].map'
},
...
I would like to have polyfill
and main
to be loaded from <script>
tag in browser, and lib
to be exported as CommonJS library.
lib
is used by Node backend but contains some of app
modules, so it is built alongside with other entry points). The application is being transpiled, so it is not possible to just require
modules from ./app
in Node.
What are the options here? Is using separate Webpack configs and separate Webpack runs the only one?