forked from jediswaplabs/analytics-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
30 lines (24 loc) · 877 Bytes
/
config-overrides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { useBabelRc } = require("customize-cra");
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
const PreloadWebpackPlugin = require('@vue/preload-webpack-plugin');
module.exports = {
webpack: function(config, env) {
config = useBabelRc()(config);
const extHtmlPlugin = new ScriptExtHtmlWebpackPlugin({
defer: ['main', 'bundle']
});
// const preloadWebpackPlugin = new PreloadWebpackPlugin({
// rel: 'preload',
// include: 'asyncChunks'
// })
config.plugins.push(extHtmlPlugin);
// config.plugins.push(preloadWebpackPlugin);
// ...add your webpack config
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
});
return config;
}
};