Skip to content

Commit 3eb16ac

Browse files
committed
1 parent 0ba0e9c commit 3eb16ac

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"zone.js": "^0.8.26"
3131
},
3232
"devDependencies": {
33-
"@angular-devkit/core": "~0.6.3",
33+
"@angular-devkit/core": "~0.7.0-beta.1",
3434
"@angular/compiler-cli": "~6.0.0",
35-
"@ngtools/webpack": "~6.0.3",
35+
"@ngtools/webpack": "~6.1.0-beta.1",
3636
"babel-traverse": "6.26.0",
3737
"babel-types": "6.26.0",
3838
"babylon": "6.18.0",
@@ -42,7 +42,7 @@
4242
"extract-text-webpack-plugin": "~3.0.2",
4343
"lazy": "1.0.11",
4444
"nativescript-dev-typescript": "~0.7.0",
45-
"nativescript-dev-webpack": "^0.12.0",
45+
"nativescript-dev-webpack": "^0.13.0",
4646
"nativescript-worker-loader": "~0.9.0",
4747
"raw-loader": "~0.5.1",
4848
"resolve-url-loader": "~2.3.0",

webpack.config.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ const { join, relative, resolve, sep } = require("path");
33
const webpack = require("webpack");
44
const nsWebpack = require("nativescript-dev-webpack");
55
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
6+
const { PlatformReplacementHost } = require("nativescript-dev-webpack/host/platform");
67
const CleanWebpackPlugin = require("clean-webpack-plugin");
78
const CopyWebpackPlugin = require("copy-webpack-plugin");
89
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
910
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1011
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
12+
const { AngularCompilerPlugin } = require("@ngtools/webpack");
1113

1214
module.exports = env => {
1315
// Add your custom Activities, Services and other Android app components here.
@@ -22,9 +24,10 @@ module.exports = env => {
2224
throw new Error("You need to provide a target platform!");
2325
}
2426

25-
const platforms = ["ios", "android"];
27+
const extensions = ["tns", platform];
28+
const platformHost = new PlatformReplacementHost(extensions);
29+
2630
const projectRoot = __dirname;
27-
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot });
2831

2932
// Default destination inside platforms/<platform>/...
3033
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
@@ -147,7 +150,7 @@ module.exports = env => {
147150
{
148151
loader: "nativescript-dev-webpack/bundle-config-loader",
149152
options: {
150-
registerPages: false,
153+
angular: true,
151154
loadCss: !snapshot, // load the application css if in debug mode
152155
}
153156
},
@@ -221,15 +224,12 @@ module.exports = env => {
221224
// For instructions on how to set up workers with webpack
222225
// check out https://github.com/nativescript/worker-loader
223226
new NativeScriptWorkerPlugin(),
224-
// AngularCompilerPlugin with augmented NativeScript filesystem to handle platform specific resource resolution.
225-
new nsWebpack.NativeScriptAngularCompilerPlugin({
227+
228+
new AngularCompilerPlugin({
229+
host: platformHost,
226230
entryModule: resolve(appPath, "app.module#AppModule"),
227231
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
228232
skipCodeGeneration: !aot,
229-
platformOptions: {
230-
platform,
231-
platforms,
232-
},
233233
}),
234234
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
235235
new nsWebpack.WatchStateLoggerPlugin(),
@@ -250,6 +250,7 @@ module.exports = env => {
250250
if (snapshot) {
251251
config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
252252
chunk: "vendor",
253+
angular: true,
253254
requireModules: [
254255
"reflect-metadata",
255256
"@angular/platform-browser",

0 commit comments

Comments
 (0)