Skip to content

Commit

Permalink
fix(@angular/cli): use webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Dec 5, 2017
1 parent 091ab2c commit c0280fb
Show file tree
Hide file tree
Showing 20 changed files with 169 additions and 123 deletions.
36 changes: 18 additions & 18 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
environment:
matrix:
- nodejs_version: "6"
# environment:
# matrix:
# - nodejs_version: "6"

matrix:
fast_finish: true
# matrix:
# fast_finish: true

install:
- ps: Install-Product node $env:nodejs_version
- npm install -g npm@~5.6.0
- npm install
# install:
# - ps: Install-Product node $env:nodejs_version
# - npm install -g npm@~5.6.0
# - npm install

test_script:
- node --version
- npm --version
- npm run test:packages
- npm run test:cli
- node tests\run_e2e.js --appveyor "--glob=tests/{basic,commands,generate}/**"
# test_script:
# - node --version
# - npm --version
# - npm run test:packages
# - npm run test:cli
# - node tests\run_e2e.js --appveyor "--glob=tests/{basic,commands,generate}/**"

build: off
# build: off

cache:
- node_modules -> package-lock.json
# cache:
# - node_modules -> package-lock.json
14 changes: 7 additions & 7 deletions lib/bootstrap-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ if (!__dirname.match(new RegExp(`\\${path.sep}node_modules\\${path.sep}`))) {
const p = path.join(packages[match].root, request.substr(match.length));
return oldLoad.call(this, p, parent);
} else {
try {
if (isAngularProject) {
return oldLoad.call(this, resolve.sync(request, { basedir: process.cwd() }), parent);
}
} catch (e) {
// Do nothing. Fallback to the old method.
}
// try {
// if (isAngularProject) {
// return oldLoad.call(this, resolve.sync(request, { basedir: process.cwd() }), parent);
// }
// } catch (e) {
// // Do nothing. Fallback to the old method.
// }

return oldLoad.apply(this, arguments);
}
Expand Down
100 changes: 77 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"chalk": "~2.2.0",
"circular-dependency-plugin": "^4.2.1",
"common-tags": "^1.3.1",
"copy-webpack-plugin": "^4.1.1",
"copy-webpack-plugin": "git://github.com/filipesilva/copy-webpack-plugin.git#patch-1-built",
"core-object": "^3.1.0",
"css-loader": "^0.28.1",
"cssnano": "^3.10.0",
Expand Down Expand Up @@ -94,7 +94,7 @@
"typescript": "~2.4.2",
"uglifyjs-webpack-plugin": "~1.1.2",
"url-loader": "^0.6.2",
"webpack": "~3.10.0",
"webpack": "4.0.0-alpha.0",
"webpack-concat-plugin": "^1.4.2",
"webpack-dev-middleware": "~1.12.0",
"webpack-dev-server": "~2.9.3",
Expand Down
5 changes: 0 additions & 5 deletions packages/@angular/cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ const BuildCommand = Command.extend({
Version.assertAngularVersionIs2_3_1OrHigher(this.project.root);
Version.assertTypescriptVersion(this.project.root);

// Force commonjs module format for TS on dev watch builds.
if (commandOptions.target === 'development' && commandOptions.watch === true) {
commandOptions.forceTsCommonjs = true;
}

const BuildTask = require('../tasks/build').default;

const buildTask = new BuildTask({
Expand Down
5 changes: 0 additions & 5 deletions packages/@angular/cli/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ const ServeCommand = Command.extend({
Version.assertAngularVersionIs2_3_1OrHigher(this.project.root);
Version.assertTypescriptVersion(this.project.root);

// Force commonjs module format for TS on dev builds.
if (commandOptions.target === 'development') {
commandOptions.forceTsCommonjs = true;
}

// Default evalSourcemaps to true for serve. This makes rebuilds faster.
commandOptions.evalSourcemaps = true;

Expand Down
7 changes: 0 additions & 7 deletions packages/@angular/cli/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export interface TestOptions {
environment?: string;
app?: string;
preserveSymlinks?: boolean;
forceTsCommonjs?: boolean;
}


Expand Down Expand Up @@ -138,12 +137,6 @@ const TestCommand = Command.extend({
commandOptions.singleRun = true;
}

// Don't force commonjs for code coverage builds, some setups need es2015 for it.
// https://github.com/angular/angular-cli/issues/5526
if (!commandOptions.codeCoverage) {
commandOptions.forceTsCommonjs = true;
}

return testTask.run(commandOptions);
}
});
Expand Down
1 change: 0 additions & 1 deletion packages/@angular/cli/models/build-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface BuildOptions {
buildOptimizer?: boolean;
namedChunks?: boolean;
subresourceIntegrity?: boolean;
forceTsCommonjs?: boolean;
serviceWorker?: boolean;
skipAppShell?: boolean;
}
Loading

0 comments on commit c0280fb

Please sign in to comment.