This repository was archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathexports.js
81 lines (69 loc) · 2.26 KB
/
exports.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module.exports = `
const mainSheet = \`app.css\`;
module.exports = env => {
const platform = getPlatform(env);
// Default destination inside platforms/<platform>/...
const path = resolve(nsWebpack.getAppPath(platform));
const entry = {
// Discover entry module from package.json
bundle: \`./\${nsWebpack.getEntryModule()}\`,
// Vendor entry with third-party libraries
vendor: \`./vendor\`,
// Entry for stylesheet with global application styles
[mainSheet]: \`./\${mainSheet}\`,
};
const rules = getRules();
const plugins = getPlugins(platform, env);
const extensions = getExtensions(platform);
const config = {
context: resolve("./app"),
target: nativescriptTarget,
entry,
output: {
pathinfo: true,
path,
libraryTarget: "commonjs2",
filename: "[name].js",
},
resolve: {
extensions,
// Resolve {N} system modules from tns-core-modules
modules: [
"node_modules/tns-core-modules",
"node_modules",
],
alias: {
'~': resolve("./app")
},
// This will not follow symlinks to their original location,
// and will enable us to work with symlinked packages during development.
symlinks: false
},
resolveLoader: {
// This will not follow symlinks to their original location,
// and will enable us to work with symlinked loader packages during development.
symlinks: false
},
node: {
// Disable node shims that conflict with NativeScript
"http": false,
"timers": false,
"setImmediate": false,
"fs": "empty",
},
module: { rules },
plugins,
};
if (env.snapshot) {
plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
chunk: "vendor",
projectRoot: __dirname,
webpackConfig: config,
targetArchs: ["arm", "arm64", "ia32"],
tnsJavaClassesOptions: { packages: ["tns-core-modules" ] },
useLibs: false
}));
}
return config;
};
`;