2021-02-15 13:27:04 -05:00
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
|
2018-09-09 17:22:44 -04:00
|
|
|
module.exports = {
|
2020-04-09 10:09:34 -04:00
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
name: "typescript",
|
|
|
|
options: {
|
|
|
|
useBabel: true,
|
|
|
|
useEslint: true,
|
|
|
|
forkTsChecker: {
|
|
|
|
tsconfig: "./tsconfig.json",
|
|
|
|
tslint: undefined,
|
|
|
|
watch: "./src",
|
|
|
|
typeCheck: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2018-09-09 17:22:44 -04:00
|
|
|
modify: (config, { target, dev }, webpack) => {
|
|
|
|
// load webfonts
|
2021-02-15 13:27:04 -05:00
|
|
|
const rules = config.module.rules || [];
|
2018-09-09 17:22:44 -04:00
|
|
|
rules.push({
|
|
|
|
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
|
|
|
loader: 'file-loader?name=public/fonts/[name].[ext]'
|
|
|
|
})
|
|
|
|
config.module.rules = rules;
|
|
|
|
|
2021-02-15 13:27:04 -05:00
|
|
|
// add the map_styles directory to the build output
|
|
|
|
const plugins = config.plugins || [];
|
|
|
|
plugins.push(new CopyWebpackPlugin({
|
|
|
|
patterns: [ {from: 'map_styles', to: "map_styles"}]
|
|
|
|
}));
|
|
|
|
config.plugins = plugins;
|
|
|
|
|
2018-09-09 17:22:44 -04:00
|
|
|
return config;
|
|
|
|
},
|
|
|
|
};
|