forked from Azure/api-management-developer-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mockStaticData.js
31 lines (23 loc) · 1.06 KB
/
webpack.mockStaticData.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 {mockStaticDataEnvironment, staticDataEnvironment} = require("./environmentConstants")
const webpack = require("webpack");
const publisherConfig = require("./webpack.publisher");
const CopyWebpackPlugin = require("copy-webpack-plugin");
let staticData = publisherConfig;
staticData.publisherConfig.mode = "none";
staticData.publisherConfig.plugins.push(new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(mockStaticDataEnvironment)
}));
staticData.publisherRuntimeConfig.mode = "none";
staticData.publisherConfig.mode = "none";
staticData.publisherConfig.plugins.push(new CopyWebpackPlugin({
patterns: [
{ from: `./src/config.validate.publish.json`, to: `config.json`, force: true },
{ from: `./src/config.validate.runtime.json`, to: `assets/config.json` , force: true},
]
}));
staticData.publisherRuntimeConfig.plugins.push(new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(mockStaticDataEnvironment),
}));
module.exports = {
default: [staticData.publisherConfig, staticData.publisherRuntimeConfig]
}