Make sure webfonts dir is copied over

Also move `custom_emojis` dir out of `dist` and copy it over as well.
This commit is contained in:
JC Brand 2020-02-13 13:33:18 +01:00
parent d833120f5e
commit 2d57f6c889
3 changed files with 6 additions and 2 deletions

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -4,7 +4,7 @@ const merge = require("webpack-merge");
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
const ASSET_PATH = process.env.ASSET_PATH || '/dist/'; // eslint-disable-line no-process-env const ASSET_PATH = process.env.ASSET_PATH || '/dist/'; // eslint-disable-line no-process-env
@ -15,7 +15,11 @@ module.exports = merge(common, {
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({filename: '../dist/converse.min.css'}), new MiniCssExtractPlugin({filename: '../dist/converse.min.css'}),
new CopyPlugin([{from: 'images/favicon.ico'}]), new CopyWebpackPlugin([
{from: 'images/favicon.ico'},
{from: 'images/custom_emojis', to: 'custom_emojis'},
{from: 'sass/webfonts', to: 'webfonts'}
]),
new webpack.DefinePlugin({ // This makes it possible for us to safely use env vars on our code 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) 'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH)
}) })