i’ve started my foray into webpack which appears to be quite promising, but the documentation is overwhelming and not very gentle for the newcomer.
i was trying to figure out how to asynchronously load files with webpack using CommonJS modules. apparently, if you specify an output.path in webpack, you will also need to specify the output.publicPath option so that webpack knows how to find the chunks.
an example working webpack.config.js file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
var path = require('path'); module.exports = { // create multiple entry points entry: { main: './main.js', page2: './page2.js' }, output: { // specify a directory to save webpack built files path: path.join(__dirname, 'public/build'), // publicPath needs to be specified for webpack to know where to find the chunks publicPath: 'public/build/', filename: '[name].js', chunkFilename: '[chunkhash].js' } }; |
Thank you, I’ve recently been searching for info approximately this subject for a
long time and yours is the greatest I have discovered so far.
However, what about the bottom line? Are you positive about the supply?