Skip to content

Commit 8fda97a

Browse files
authored
refactor: update to nativescript-dev-webpack 0.14.0 (#26)
The webpack packages required for the {N} build are now dependencies of the nativescript-dev-webpack plugin. We can now remove them from the project's package.json and stop running `npm i` twice when adding `nativescript-dev-webpack` to the project.
1 parent 8028706 commit 8fda97a

File tree

3 files changed

+5
-42
lines changed

3 files changed

+5
-42
lines changed

src/add-ns/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,15 @@ const installNpmModules = () => (_tree: Tree, context: SchematicContext) => {
157157
'tns-core-modules': '~4.1.0'
158158
},
159159
devDependencies: {
160-
'nativescript-dev-typescript': '~0.7.0',
161-
'nativescript-dev-webpack': '^0.13.0',
162-
'@angular/cli': '6.1.0-beta.0',
163-
164-
'@angular-devkit/build-angular': '0.7.0-beta.2',
165-
'@angular-devkit/core': '0.7.0-beta.2',
166-
167-
'typescript': '2.7.2'
160+
'nativescript-dev-webpack': '^0.14.0'
168161
}
169162
}
170163

171164
const options: NpmInstallOptions = {
172165
json: JSON.stringify(dependeciesToAdd)
173166
}
174-
const taskId = context.addTask(new RunSchematicTask('@nativescript/schematics', 'npm-install', options));
175-
176-
// run for the second time, to npm install modules added by nativescript-dev-webpack
177-
// npmInstallTaskId = context.addTask(new RunSchematicTask('@nativescript/schematics', 'npm-install', {}), [taskId]);
178-
context.addTask(new RunSchematicTask('@nativescript/schematics', 'npm-install', {}), [taskId]);
179167

168+
context.addTask(new RunSchematicTask('@nativescript/schematics', 'npm-install', options));
180169
}
181170

182171
const addWebpackConfig = () => (tree:Tree) => {

src/ng-new/application/_files/package.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,9 @@
3030
"babel-traverse": "6.26.0",
3131
"babel-types": "6.26.0",
3232
"babylon": "6.18.0",
33-
"clean-webpack-plugin": "~0.1.19",
34-
"copy-webpack-plugin": "~4.5.1",
35-
"css-loader": "~0.28.11",
36-
"extract-text-webpack-plugin": "~3.0.2",
3733
"lazy": "1.0.11",
38-
"nativescript-dev-webpack": "^0.13.0",
34+
"nativescript-dev-webpack": "^0.14.0",
3935
"nativescript-dev-typescript": "~0.7.0",
40-
"nativescript-worker-loader": "~0.9.0",
41-
"raw-loader": "~0.5.1",
42-
"resolve-url-loader": "~2.3.0",
43-
"typescript": "~2.7.2",
44-
"uglifyjs-webpack-plugin": "~1.2.5",
45-
"webpack": "~4.6.0",
46-
"webpack-bundle-analyzer": "~2.13.0",
47-
"webpack-cli": "~2.1.3",
48-
"webpack-sources": "~1.1.0"
36+
"typescript": "~2.7.2"
4937
}
5038
}

src/ng-new/shared/_files/package.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
3434
"devDependencies": {
3535
"@angular/compiler-cli": "^6.0.3",
3636
"@angular-devkit/build-angular": "0.7.0-beta.0",
37-
"@angular-devkit/core": "0.7.0-beta.0",
3837
"typescript": "2.7.2",
3938
"@angular/cli": "6.1.0-beta.0",
40-
"@ngtools/webpack": "6.1.0-beta.0",
4139
"@angular/language-service": "^6.0.3",
4240
"@types/jasmine": "~2.8.6",
4341
"@types/jasminewd2": "~2.0.3",
@@ -54,18 +52,6 @@
5452
"ts-node": "~5.0.1",
5553
"tslint": "~5.9.1",
5654
"nativescript-dev-typescript": "~0.7.0",
57-
"nativescript-dev-webpack": "^0.13.0",
58-
"webpack": "~4.6.0",
59-
"webpack-cli": "~2.1.3",
60-
"webpack-bundle-analyzer": "~2.13.0",
61-
"webpack-sources": "~1.1.0",
62-
"clean-webpack-plugin": "~0.1.19",
63-
"copy-webpack-plugin": "~4.5.1",
64-
"raw-loader": "~0.5.1",
65-
"css-loader": "~0.28.11",
66-
"nativescript-worker-loader": "~0.9.0",
67-
"extract-text-webpack-plugin": "~3.0.2",
68-
"uglifyjs-webpack-plugin": "~1.2.5",
69-
"resolve-url-loader": "~2.3.0"
55+
"nativescript-dev-webpack": "^0.14.0"
7056
}
7157
}

0 commit comments

Comments
 (0)