Commit 41c4f9ce authored by JC Brand's avatar JC Brand

Update nodeps webpack config to create chunks in the right place

parent bd67dc3f
......@@ -5,6 +5,11 @@ const path = require('path');
const webpack = require('webpack');
const config = {
output: {
path: path.resolve(__dirname, 'dist'), // Output path for generated bundles
publicPath: '/dist/', // URL base path for all assets
chunkFilename: '[name].js'
},
entry: path.resolve(__dirname, 'src/converse.js'),
externals: [{
"window": "window"
......@@ -148,36 +153,11 @@ function parameterize () {
const type = minimist(process.argv.slice(2)).type;
const mode = minimist(process.argv.slice(2)).mode;
const lang = minimist(process.argv.slice(2)).lang;
if (type === 'headless') {
console.log("Making a headless build");
config.entry = "@converse/headless/headless.js";
config.output.filename = 'converse-headless.js';
}
if (type === 'nodeps') {
console.log("Making a build without 3rd party dependencies");
config.output.filename = 'converse-no-dependencies.js';
config.externals = [{
"backbone": "backbone",
"backbone.nativeview": "backbone.nativeview",
"backbone.vdomview": "backbone.vdomview",
"backbone.browserStorage": "backbone.browserStorage",
"backbone.overview": "backbone.overview",
"es6-promise": "es6-promise",
"lodash": "lodash",
"lodash.converter": "lodash.converter",
"lodash.noconflict": "lodash.noconflict",
"strophe": "strophe",
"window": "window"
}];
}
if (mode === 'production') {
console.log("Making a production build");
const fn = config.output.filename;
config.output.filename = `${fn.replace(/\.js$/, '')}.min.js`;
}
}
parameterize();
......
......@@ -55,7 +55,6 @@ module.exports = merge(common, {
"es6-promise": "es6-promise",
"formdata-polyfill": "formdata-polyfill",
"lodash": "lodash",
"lodash.converter": "lodash.converter",
"lodash.noconflict": "lodash.noconflict",
"strophe": "strophe",
"window": "window",
......
......@@ -6,10 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = merge(common, {
output: {
path: path.resolve(__dirname, 'dist'), // Output path for generated bundles
publicPath: '/dist/', // URL base path for all assets
filename: 'converse.min.js',
chunkFilename: '[name].js'
},
plugins: [
new MiniCssExtractPlugin({filename: '../dist/converse.min.css'})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment