Skip to content

Commit ebbb726

Browse files
authored
chore: update to latest nativescript-dev-webpack plugin configs (#27)
1 parent c963908 commit ebbb726

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"resolve-url-loader": "~2.0.2",
4747
"tslint": "^5.4.3",
4848
"typescript": "~2.3.4",
49-
"webpack": "~2.6.1",
49+
"webpack": "~3.0.0",
5050
"webpack-sources": "~1.0.1",
5151
"webpack-bundle-analyzer": "^2.8.2"
5252
},
@@ -60,4 +60,4 @@
6060
"build-android-bundle": "npm run ns-bundle --android --build-app",
6161
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
6262
}
63-
}
63+
}

Diff for: webpack.config.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const nsWebpack = require("nativescript-dev-webpack");
55
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
66
const CopyWebpackPlugin = require("copy-webpack-plugin");
77
const ExtractTextPlugin = require("extract-text-webpack-plugin");
8+
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
89

910
const { AotPlugin } = require("@ngtools/webpack");
1011

@@ -48,7 +49,11 @@ module.exports = env => {
4849
modules: [
4950
"node_modules/tns-core-modules",
5051
"node_modules",
51-
]
52+
],
53+
54+
alias: {
55+
'~': resolve("./app")
56+
},
5257
},
5358
node: {
5459
// Disable node shims that conflict with NativeScript
@@ -166,6 +171,15 @@ function getPlugins(platform, env) {
166171
"./bundle",
167172
]),
168173

174+
// Generate report files for bundles content
175+
new BundleAnalyzerPlugin({
176+
analyzerMode: "static",
177+
openAnalyzer: false,
178+
generateStatsFile: true,
179+
reportFilename: join(__dirname, "report", `report.html`),
180+
statsFilename: join(__dirname, "report", `stats.json`),
181+
}),
182+
169183
// Angular AOT compiler
170184
new AotPlugin({
171185
tsConfigPath: "tsconfig.aot.json",

0 commit comments

Comments
 (0)