Skip to content

Commit bbbdff3

Browse files
committed
ExcludeUnusedElementsPlugin enabled and comments disabled
1 parent 05cbb9d commit bbbdff3

File tree

2 files changed

+115
-106
lines changed

2 files changed

+115
-106
lines changed

package.json

Lines changed: 106 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,109 @@
11
{
2-
"name": "nativescript-sdk-examples-ng",
3-
"description": "NativeScript & Angular 2 SDK Examples",
4-
"author": "Telerik <[email protected]>",
5-
"version": "0.1.0",
6-
"homepage": "https://github.com/NativeScript/nativescript-sdk-examples-ng",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://github.com/NativeScript/nativescript-sdk-examples-ng"
10-
},
11-
"bugs": {
12-
"url": "https://github.com/NativeScript/nativescript-sdk-examples-ng/issues"
13-
},
14-
"keywords": [
15-
"NativeScript",
16-
"Angular",
17-
"SDK",
18-
"example",
19-
"documentation"
20-
],
21-
"license": "Apache-2.0",
22-
"nativescript": {
23-
"id": "org.nativescript.nativescriptsdkexamplesng",
24-
"tns-ios": {
25-
"version": "2.4.0"
2+
"name": "nativescript-sdk-examples-ng",
3+
"description": "NativeScript & Angular 2 SDK Examples",
4+
"author": "Telerik <[email protected]>",
5+
"version": "0.1.0",
6+
"homepage": "https://github.com/NativeScript/nativescript-sdk-examples-ng",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/NativeScript/nativescript-sdk-examples-ng"
2610
},
27-
"tns-android": {
28-
"version": "2.4.1"
11+
"bugs": {
12+
"url": "https://github.com/NativeScript/nativescript-sdk-examples-ng/issues"
13+
},
14+
"keywords": [
15+
"NativeScript",
16+
"Angular",
17+
"SDK",
18+
"example",
19+
"documentation"
20+
],
21+
"license": "Apache-2.0",
22+
"nativescript": {
23+
"id": "org.nativescript.nativescriptsdkexamplesng",
24+
"tns-ios": {
25+
"version": "2.4.0"
26+
},
27+
"tns-android": {
28+
"version": "2.4.1"
29+
}
30+
},
31+
"dependencies": {
32+
"@angular/common": "2.3.1",
33+
"@angular/compiler": "2.3.1",
34+
"@angular/core": "2.3.1",
35+
"@angular/forms": "2.3.1",
36+
"@angular/http": "2.3.1",
37+
"@angular/platform-browser": "2.3.1",
38+
"@angular/platform-browser-dynamic": "2.3.1",
39+
"@angular/router": "3.3.1",
40+
"nativescript-angular": "1.3.0",
41+
"nativescript-camera": "0.0.7",
42+
"nativescript-geolocation": "0.0.14",
43+
"nativescript-googlemaps": "0.0.6",
44+
"nativescript-intl": "~0.0.6",
45+
"nativescript-theme-core": "^1.0.0",
46+
"reflect-metadata": "~0.1.8",
47+
"rxjs": "5.0.0-rc.4",
48+
"tns-core-modules": "2.4.4"
49+
},
50+
"devDependencies": {
51+
"@angular/compiler-cli": "2.3.1",
52+
"@ngtools/webpack": "1.2.1",
53+
"babel-traverse": "6.11.4",
54+
"babel-types": "6.11.1",
55+
"babylon": "6.8.4",
56+
"codelyzer": "~2.0.0-beta.3",
57+
"copy-webpack-plugin": "~3.0.1",
58+
"css-loader": "~0.26.0",
59+
"extract-text-webpack-plugin": "~2.0.0-beta.4",
60+
"fs-extra": "^0.30.0",
61+
"glob": "^7.0.5",
62+
"lazy": "1.0.11",
63+
"markdown-snippet-injector": "^0.2.0",
64+
"nativescript-dev-typescript": "^0.3.2",
65+
"nativescript-dev-webpack": "^0.3.0",
66+
"opener": "^1.4.1",
67+
"raw-loader": "~0.5.1",
68+
"resolve-url-loader": "~1.6.0",
69+
"rimraf": "^2.5.3",
70+
"tar.gz": "^1.0.5",
71+
"tns-platform-declarations": "^2.4.0",
72+
"tslint": "~4.0.2",
73+
"typescript": "~2.0.3",
74+
"webpack": "~2.1.0-beta.27",
75+
"webpack-sources": "~0.1.3",
76+
"zone.js": "~0.7.2",
77+
"nativescript-css-loader": "~0.26.0",
78+
"htmlparser2": "^3.9.2"
79+
},
80+
"scripts": {
81+
"pretsc": "npm install",
82+
"tsc": "tsc",
83+
"pretslint": "npm run tsc",
84+
"tslint": "tslint -C tsconfig.json --project tslint.json",
85+
"prebuild": "npm run tslint",
86+
"build": "node scripts/build.js",
87+
"postbuild": "npm run inject && npm run archive",
88+
"inject": "mdinject --root=app --docsroot=dist/sdk-examples --sourceext=\".ts|.css|.html\" --snippettitles=\"TypeScript|CSS|HTML\"",
89+
"archive": "node scripts/archive.js",
90+
"prepush-to-github": "npm run build",
91+
"push-to-github": "(cd dist/sdk-examples && rimraf .git && git init && git add -A && git commit -m \"nativescript-sdk-examples build preview\" && git remote add origin [email protected]:NativeScript/nativescript-sdk-examples-preview.git && git push -u --force origin master)",
92+
"preshow-preview": "npm run push-to-github",
93+
"show-preview": "opener https://github.com/NativeScript/nativescript-sdk-examples-preview",
94+
"clean-android": "tns clean-app android",
95+
"clean-ios": "tns clean-app ios",
96+
"prewebpack-android": "npm run clean-android",
97+
"prewebpack-ios": "npm run clean-ios",
98+
"webpack-android": "webpack --config=webpack.android.js --progress",
99+
"webpack-ios": "webpack --config=webpack.ios.js --progress",
100+
"prestart-android-bundle": "npm run webpack-android",
101+
"prestart-ios-bundle": "npm run webpack-ios",
102+
"start-android-bundle": "tns run android --bundle --disable-npm-install",
103+
"start-ios-bundle": "tns run ios --bundle --disable-npm-install",
104+
"prebuild-android-bundle": "npm run webpack-android",
105+
"prebuild-ios-bundle": "npm run webpack-ios",
106+
"build-android-bundle": "tns build android --bundle --disable-npm-install",
107+
"build-ios-bundle": "tns build ios --bundle --disable-npm-install"
29108
}
30-
},
31-
"dependencies": {
32-
"@angular/common": "2.3.1",
33-
"@angular/compiler": "2.3.1",
34-
"@angular/core": "2.3.1",
35-
"@angular/forms": "2.3.1",
36-
"@angular/http": "2.3.1",
37-
"@angular/platform-browser": "2.3.1",
38-
"@angular/platform-browser-dynamic": "2.3.1",
39-
"@angular/router": "3.3.1",
40-
"nativescript-angular": "1.3.0",
41-
"nativescript-camera": "0.0.7",
42-
"nativescript-geolocation": "0.0.14",
43-
"nativescript-googlemaps": "0.0.6",
44-
"nativescript-intl": "~0.0.6",
45-
"nativescript-theme-core": "^1.0.0",
46-
"reflect-metadata": "~0.1.8",
47-
"rxjs": "5.0.0-rc.4",
48-
"tns-core-modules": "2.4.4"
49-
},
50-
"devDependencies": {
51-
"@angular/compiler-cli": "2.3.1",
52-
"@ngtools/webpack": "1.2.1",
53-
"babel-traverse": "6.11.4",
54-
"babel-types": "6.11.1",
55-
"babylon": "6.8.4",
56-
"codelyzer": "~2.0.0-beta.3",
57-
"copy-webpack-plugin": "~3.0.1",
58-
"css-loader": "~0.26.0",
59-
"extract-text-webpack-plugin": "~2.0.0-beta.4",
60-
"fs-extra": "^0.30.0",
61-
"glob": "^7.0.5",
62-
"lazy": "1.0.11",
63-
"markdown-snippet-injector": "^0.2.0",
64-
"nativescript-dev-typescript": "^0.3.2",
65-
"nativescript-dev-webpack": "^0.3.0",
66-
"opener": "^1.4.1",
67-
"raw-loader": "~0.5.1",
68-
"resolve-url-loader": "~1.6.0",
69-
"rimraf": "^2.5.3",
70-
"tar.gz": "^1.0.5",
71-
"tns-platform-declarations": "^2.4.0",
72-
"tslint": "~4.0.2",
73-
"typescript": "~2.0.3",
74-
"webpack": "~2.1.0-beta.27",
75-
"webpack-sources": "~0.1.3",
76-
"zone.js": "~0.7.2"
77-
},
78-
"scripts": {
79-
"pretsc": "npm install",
80-
"tsc": "tsc",
81-
"pretslint": "npm run tsc",
82-
"tslint": "tslint -C tsconfig.json --project tslint.json",
83-
"prebuild": "npm run tslint",
84-
"build": "node scripts/build.js",
85-
"postbuild": "npm run inject && npm run archive",
86-
"inject": "mdinject --root=app --docsroot=dist/sdk-examples --sourceext=\".ts|.css|.html\" --snippettitles=\"TypeScript|CSS|HTML\"",
87-
"archive": "node scripts/archive.js",
88-
"prepush-to-github": "npm run build",
89-
"push-to-github": "(cd dist/sdk-examples && rimraf .git && git init && git add -A && git commit -m \"nativescript-sdk-examples build preview\" && git remote add origin [email protected]:NativeScript/nativescript-sdk-examples-preview.git && git push -u --force origin master)",
90-
"preshow-preview": "npm run push-to-github",
91-
"show-preview": "opener https://github.com/NativeScript/nativescript-sdk-examples-preview",
92-
"clean-android": "tns clean-app android",
93-
"clean-ios": "tns clean-app ios",
94-
"prewebpack-android": "npm run clean-android",
95-
"prewebpack-ios": "npm run clean-ios",
96-
"webpack-android": "webpack --config=webpack.android.js --progress",
97-
"webpack-ios": "webpack --config=webpack.ios.js --progress",
98-
"prestart-android-bundle": "npm run webpack-android",
99-
"prestart-ios-bundle": "npm run webpack-ios",
100-
"start-android-bundle": "tns run android --bundle --disable-npm-install",
101-
"start-ios-bundle": "tns run ios --bundle --disable-npm-install",
102-
"prebuild-android-bundle": "npm run webpack-android",
103-
"prebuild-ios-bundle": "npm run webpack-ios",
104-
"build-android-bundle": "tns build android --bundle --disable-npm-install",
105-
"build-ios-bundle": "tns build ios --bundle --disable-npm-install"
106-
}
107-
}
109+
}

webpack.common.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ module.exports = function (platform, destinationApp) {
4545
"./vendor",
4646
"./bundle",
4747
]),
48+
// Exclude explicitly required but never declared in XML elements.
49+
// Loader nativescript-dev-webpack/tns-xml-loader should be added for *.xml/html files.
50+
new nsWebpack.ExcludeUnusedElementsPlugin(),
4851
//Angular AOT compiler
4952
new AotPlugin({
5053
tsConfigPath: "tsconfig.aot.json",
@@ -61,6 +64,7 @@ module.exports = function (platform, destinationApp) {
6164
except: nsWebpack.uglifyMangleExcludes,
6265
},
6366
compress: compress,
67+
comments: false
6468
}));
6569
}
6670

@@ -100,8 +104,11 @@ module.exports = function (platform, destinationApp) {
100104
module: {
101105
loaders: [
102106
{
103-
test: /\.html$/,
104-
loader: "raw-loader"
107+
test: /\.html$|\.xml$/,
108+
loaders: [
109+
"raw-loader",
110+
'nativescript-dev-webpack/tns-xml-loader'
111+
]
105112
},
106113
// Root app.css file gets extracted with bundled dependencies
107114
{

0 commit comments

Comments
 (0)