2021-04-18 15:38:21 -04:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
2021-02-15 13:27:04 -05:00
|
|
|
|
2018-09-09 17:22:44 -04:00
|
|
|
module.exports = {
|
2020-04-09 10:09:34 -04:00
|
|
|
plugins: [
|
|
|
|
{
|
2021-04-18 15:38:21 -04:00
|
|
|
name: 'typescript',
|
2020-04-09 10:09:34 -04:00
|
|
|
options: {
|
|
|
|
forkTsChecker: {
|
2021-04-18 15:38:21 -04:00
|
|
|
eslint: undefined // { files: './src/**/*.{ts,tsx,js,jsx}' }
|
2020-04-09 10:09:34 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2021-04-18 15:38:21 -04:00
|
|
|
modifyWebpackConfig({ env: { target, dev }, webpackConfig }) {
|
2018-09-09 17:22:44 -04:00
|
|
|
// load webfonts
|
2021-04-18 15:38:21 -04:00
|
|
|
webpackConfig.module.rules = webpackConfig.module.rules || [];
|
|
|
|
webpackConfig.module.rules.push({
|
2018-09-09 17:22:44 -04:00
|
|
|
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
2021-04-18 15:38:21 -04:00
|
|
|
type: 'asset/resource'
|
|
|
|
});
|
2018-09-09 17:22:44 -04:00
|
|
|
|
2021-02-15 13:27:04 -05:00
|
|
|
// add the map_styles directory to the build output
|
2021-04-18 15:38:21 -04:00
|
|
|
const plugins = webpackConfig.plugins || [];
|
|
|
|
plugins.push(new CopyPlugin({
|
|
|
|
patterns: [ {from: 'map_styles', to: 'map_styles'}]
|
2021-02-15 13:27:04 -05:00
|
|
|
}));
|
2021-04-18 15:38:21 -04:00
|
|
|
webpackConfig.plugins = plugins;
|
2021-02-15 13:27:04 -05:00
|
|
|
|
2021-04-18 15:38:21 -04:00
|
|
|
return webpackConfig;
|
2018-09-09 17:22:44 -04:00
|
|
|
},
|
|
|
|
};
|