-
Notifications
You must be signed in to change notification settings - Fork 40
/
config-overrides.js
31 lines (29 loc) · 908 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
31
const CopyPlugin = require("copy-webpack-plugin");
const path = require("path");
const sdkPath = path.resolve(
__dirname,
"node_modules/@pattern-x/gemini-viewer-threejs/dist"
);
module.exports = {
webpack: function (config, env) {
let demoDistPath = path.resolve(__dirname, "public/demo/libs");
if (env === 'production') {
demoDistPath = path.resolve(__dirname, "build/demo/libs");
}
//do stuff with the webpack config...
config.optimization.minimizer[0].options.extractComments = false;
config.plugins.push(
new CopyPlugin({
patterns: [{ force: true, from: sdkPath, to: demoDistPath }],
})
);
return config;
},
devServer: function(configFunction) {
return function(proxy, allowedHost) {
const config = configFunction(proxy, allowedHost);
config.devMiddleware.writeToDisk = true;
return config;
};
}
};