Skip to content

Commit 20c6f51

Browse files
committed
chore: update webpack configs for Angular 5
1 parent 98105ae commit 20c6f51

File tree

6 files changed

+109
-214
lines changed

6 files changed

+109
-214
lines changed

app/vendor-platform.android.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (!global["__snapshot"]) {
44
// but will not be required/evaluated.
55
// The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
66
// This way, they will be evaluated on app start as early as possible.
7-
87
require("ui/frame");
98
require("ui/frame/activity");
109
}

app/vendor-platform.ios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Workaround for bug in angular: https://github.com/angular/angular-cli/pull/8589/files
2+
(<any>global).noOp;

app/vendor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Snapshot the ~/app.css and the theme
2+
const application = require("application");
3+
require("ui/styling/style-scope");
4+
global.registerModule("app.css", () => require("~/app.css"));
5+
application.loadAppCss();
6+
17
require("./vendor-platform");
28

39
require("reflect-metadata");

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,36 @@
3131
},
3232
"devDependencies": {
3333
"@angular/compiler-cli": "~5.0.0",
34-
"@ngtools/webpack": "~1.5.3",
34+
"@ngtools/webpack": "~1.8.2",
3535
"babel-traverse": "6.24.1",
3636
"babel-types": "6.24.1",
3737
"babylon": "6.17.0",
3838
"codelyzer": "^3.0.1",
3939
"copy-webpack-plugin": "~4.0.1",
40-
"extract-text-webpack-plugin": "~2.1.0",
40+
"extract-text-webpack-plugin": "~3.0.0",
4141
"filewalker": "^0.1.3",
4242
"lazy": "1.0.11",
4343
"nativescript-css-loader": "~0.26.0",
4444
"nativescript-dev-typescript": "^0.4.5",
4545
"nativescript-dev-webpack": "next",
4646
"raw-loader": "~0.5.1",
47-
"resolve-url-loader": "~2.0.2",
47+
"resolve-url-loader": "~2.1.0",
4848
"tslint": "^5.4.3",
4949
"typescript": "~2.4.2",
50-
"webpack": "~3.0.0",
50+
"webpack": "~3.8.1",
5151
"webpack-sources": "~1.0.1",
5252
"webpack-bundle-analyzer": "^2.8.2",
53-
"nativescript-worker-loader": "~0.8.1"
53+
"nativescript-worker-loader": "~0.8.1",
54+
"css-loader": "~0.28.7"
5455
},
5556
"scripts": {
56-
"ns-bundle": "ns-bundle",
57-
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
58-
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
5957
"tslint": "tslint --config tslint.json 'app/**/*.ts'",
58+
"ns-bundle": "ns-bundle",
6059
"start-android-bundle": "npm run ns-bundle --android --run-app",
6160
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
6261
"build-android-bundle": "npm run ns-bundle --android --build-app",
63-
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
62+
"build-ios-bundle": "npm run ns-bundle --ios --build-app",
63+
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
64+
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install"
6465
}
6566
}

tsconfig.aot.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,5 @@
11
{
22
"extends": "./tsconfig",
3-
"compilerOptions": {
4-
"baseUrl": ".",
5-
"paths": {
6-
"ui/*": ["node_modules/tns-core-modules/ui/*"],
7-
"platform": ["node_modules/tns-core-modules/platform"],
8-
"image-source": ["node_modules/tns-core-modules/image-source"],
9-
"xml": ["node_modules/tns-core-modules/xml"],
10-
"xhr": ["node_modules/tns-core-modules/xhr"],
11-
"text": ["node_modules/tns-core-modules/text"],
12-
"data": ["node_modules/tns-core-modules/data"],
13-
"fetch": ["node_modules/tns-core-modules/fetch"],
14-
"trace": ["node_modules/tns-core-modules/trace"],
15-
"fps-meter": ["node_modules/tns-core-modules/fps-meter"],
16-
"color": ["node_modules/tns-core-modules/color"],
17-
"application-settings": ["node_modules/tns-core-modules/application-settings"],
18-
"http": ["node_modules/tns-core-modules/http"],
19-
"camera": ["node_modules/tns-core-modules/camera"],
20-
"console": ["node_modules/tns-core-modules/console"],
21-
"timer": ["node_modules/tns-core-modules/timer"],
22-
"utils": ["node_modules/tns-core-modules/utils"],
23-
"location": ["node_modules/tns-core-modules/location"],
24-
"file-system": ["node_modules/tns-core-modules/file-system"],
25-
"application": ["node_modules/tns-core-modules/application"],
26-
"image-asset": ["node_modules/tns-core-modules/image-asset"],
27-
"connectivity": ["node_modules/tns-core-modules/connectivity"],
28-
"globals": ["node_modules/tns-core-modules/globals"]
29-
}
30-
},
31-
"exclude": [
32-
"node_modules",
33-
"platforms"
34-
],
353
"angularCompilerOptions": {
364
"skipMetadataEmit": true,
375
"genDir": "./"

0 commit comments

Comments
 (0)