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