-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (24 loc) · 922 Bytes
/
webpack.config.js
File metadata and controls
35 lines (24 loc) · 922 Bytes
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
32
33
const webpack = require("@nativescript/webpack");
const { merge } = require('webpack-merge');
module.exports = (env) => {
webpack.init(env);
// Learn how to customize:
// https://docs.nativescript.org/webpack
// NativeScript sets env.unitTesting to true when running test
if (env.unitTesting == true) {
// AngularWebpackPlugin is used by @nativescript/webpack to set tsconfig
// overwrite the default value when it's running test to use tsconfig.test.json
// reference for changing an existing plugin
// https://docs.nativescript.org/webpack.html#changing-an-existing-plugin-configuration
webpack.chainWebpack((config) => {
console.log("Setting test runner to stay open");
config.plugin('DefinePlugin').tap((args) => {
args[0] = merge(args[0], {
__TEST_RUNNER_STAY_OPEN__: true,
});
return args;
});
});
}
return webpack.resolveConfig();
};