4b6626ee70
I've now also figured out why loading of chunks failed when running using converse.js (but not when using converse.min.js or when running `make watch`). When running `make dist`, first `converse.js` and `converse.min.js` were built with `mode` set to `development` (via `webpack.dev.js`) and then `converse.min.js` was again built with mode set to `production` (via `webpack.prod.js`). When running only one build or the other (either `webpack.dev.js` or `webpack.prod.js`) then the loading of chunks didn't fail, so it had something to do with running both builds back to back. I've now removed the `.dev.js` webpack config files and instead build the minimized and non-minimized from the same config file `webpack.build.js`. I did the same for the headless builds.
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
/* global module, __dirname */
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const common = require("./webpack.common.js");
|
|
const path = require('path');
|
|
const { merge} = require("webpack-merge");
|
|
|
|
module.exports = merge(common, {
|
|
mode: "production",
|
|
entry: {
|
|
"converse-no-dependencies": path.resolve(__dirname, "../src/entry.js"),
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({filename: 'tmp.css'})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
'css-loader',
|
|
{
|
|
loader: 'sass-loader',
|
|
options: {
|
|
sassOptions: {
|
|
includePaths: [path.resolve(__dirname, '../node_modules/')]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}]
|
|
},
|
|
externals: [{
|
|
'pluggable.js': 'pluggable',
|
|
'@converse/skeletor': 'skeletor',
|
|
'localforage': 'localforage',
|
|
'filesize': 'filesize',
|
|
'jed': 'jed',
|
|
'lodash': 'lodash',
|
|
'lodash.noconflict': 'lodash.noconflict',
|
|
'sizzle': 'sizzle',
|
|
'strophe.js': 'strophe',
|
|
'urijs': 'urijs',
|
|
'window': 'window',
|
|
}]
|
|
});
|