2020-11-22 20:50:07 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2020 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-09-15 07:26:44 +00:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
2020-09-20 21:22:37 +00:00
|
|
|
const { when } = require('@craco/craco');
|
|
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
2020-09-15 07:26:44 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
webpack: {
|
|
|
|
plugins: [
|
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: 'node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm', to: 'static/js' },
|
2020-10-10 21:12:17 +00:00
|
|
|
{ from: 'node_modules/@hpcc-js/wasm/dist/expatlib.wasm', to: 'static/js' },
|
|
|
|
{ from: 'node_modules/emojibase-data/en/data.json', to: 'static/js/emoji-data.json' }
|
2020-09-15 07:26:44 +00:00
|
|
|
],
|
|
|
|
}),
|
2020-09-20 21:22:37 +00:00
|
|
|
...when(Boolean(process.env.ANALYZE), () => [
|
|
|
|
new BundleAnalyzerPlugin({
|
|
|
|
analyzerMode: "static",
|
|
|
|
generateStatsFile: true
|
|
|
|
})
|
|
|
|
], [])
|
2020-09-15 07:26:44 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|