Fix webpack issue where copied font files get removed

This commit is contained in:
JC Brand 2020-02-13 17:00:56 +01:00
parent ed411c226d
commit c2fe2aabff
2 changed files with 3 additions and 7 deletions

View File

@ -4,11 +4,8 @@ const prod = require("./webpack.prod.js");
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ASSET_PATH = process.env.ASSET_PATH || '/dist/'; // eslint-disable-line no-process-env
module.exports = merge(prod, {
output: {
publicPath: ASSET_PATH,
filename: 'converse.js',
},
optimization: {
@ -17,8 +14,5 @@ module.exports = merge(prod, {
devtool: 'source-map',
plugins: [
new MiniCssExtractPlugin({filename: '../dist/converse.css'}),
new webpack.DefinePlugin({ // This makes it possible for us to safely use env vars on our code
'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH)
})
],
});

View File

@ -14,8 +14,10 @@ module.exports = merge(common, {
filename: 'converse.min.js',
},
plugins: [
new CleanWebpackPlugin({
cleanStaleWebpackAssets: false // resolves conflict with CopyWebpackPlugin
}),
new MiniCssExtractPlugin({filename: '../dist/converse.min.css'}),
new CleanWebpackPlugin(),
new CopyWebpackPlugin([
{from: 'images/favicon.ico'},
{from: 'images/custom_emojis', to: 'custom_emojis'},