diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8eea58c067e..19f28a72021d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,24 @@
+
+# [1.0.0-beta.21](https://github.com/angular/angular-cli/compare/v1.0.0-beta.20-1...v1.0.0-beta.21) (2016-11-23)
+
+
+### Bug Fixes
+
+* **angular-cli:** add necessary dependencies. ([#3152](https://github.com/angular/angular-cli/issues/3152)) ([8f574e4](https://github.com/angular/angular-cli/commit/8f574e4)), closes [#3148](https://github.com/angular/angular-cli/issues/3148)
+* **angular-cli:** add necessary dependency. ([f7704b0](https://github.com/angular/angular-cli/commit/f7704b0))
+* **angular-cli:** change version of webpack plugin. ([07e96ea](https://github.com/angular/angular-cli/commit/07e96ea))
+* **aot:** lock the angular version to 2.2.1. ([#3242](https://github.com/angular/angular-cli/issues/3242)) ([6e8a848](https://github.com/angular/angular-cli/commit/6e8a848))
+* **editorconfig:** use off instead of 0 for max line length ([#3186](https://github.com/angular/angular-cli/issues/3186)) ([f833d25](https://github.com/angular/angular-cli/commit/f833d25))
+* **generate:** revert change to component dir in generate module, as it caused component declaration to go to parent module ([#3158](https://github.com/angular/angular-cli/issues/3158)) ([71bf855](https://github.com/angular/angular-cli/commit/71bf855))
+* **github-pages-deploy:** Show more accurate url ([#3160](https://github.com/angular/angular-cli/issues/3160)) ([a431389](https://github.com/angular/angular-cli/commit/a431389))
+
+
+### Features
+
+* **build:** add sourcemap option ([#3113](https://github.com/angular/angular-cli/issues/3113)) ([6f9d2c1](https://github.com/angular/angular-cli/commit/6f9d2c1))
+
+
+
# [1.0.0-beta.20](https://github.com/angular/angular-cli/compare/v1.0.0-beta.19...v1.0.0-beta.20-1) (2016-11-16)
diff --git a/package.json b/package.json
index e0e87c9f9c44..917dbb35b21d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-cli",
- "version": "1.0.0-beta.20-1",
+ "version": "1.0.0-beta.21",
"description": "CLI tool for Angular",
"main": "packages/angular-cli/lib/cli/index.js",
"trackingCode": "UA-8594346-19",
@@ -34,10 +34,6 @@
"npm": ">= 3.0.0"
},
"author": "Angular Authors",
- "contributors": [
- "Rody Haddad (http://rodyhaddad.com/)",
- "Igor Minar "
- ],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
@@ -45,10 +41,10 @@
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-cli/ast-tools": "^1.0.0",
- "@angular/compiler": "^2.1.0",
- "@angular/compiler-cli": "^2.1.0",
- "@angular/core": "^2.1.0",
- "@angular/tsc-wrapped": "^0.3.0",
+ "@angular/compiler": "2.2.1",
+ "@angular/compiler-cli": "2.2.1",
+ "@angular/core": "2.2.1",
+ "@angular/tsc-wrapped": "0.4.0",
"angular2-template-loader": "^0.5.0",
"autoprefixer": "^6.5.3",
"awesome-typescript-loader": "^2.2.3",
diff --git a/packages/angular-cli/blueprints/component-test/index.js b/packages/angular-cli/blueprints/component-test/index.js
deleted file mode 100644
index 50992809f319..000000000000
--- a/packages/angular-cli/blueprints/component-test/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = {
- description: '',
-
- // ******************************************************
- // ******************************************************
- // LEAVE THIS HERE
- // Must override install to prevent ember's component tests
- // ******************************************************
- // ******************************************************
-
- install: function () {
- }
-};
diff --git a/packages/angular-cli/blueprints/component/index.js b/packages/angular-cli/blueprints/component/index.js
index 523427fc2226..b5c529fe9774 100644
--- a/packages/angular-cli/blueprints/component/index.js
+++ b/packages/angular-cli/blueprints/component/index.js
@@ -18,14 +18,17 @@ module.exports = {
{ name: 'prefix', type: Boolean, default: true },
{ name: 'spec', type: Boolean },
{ name: 'view-encapsulation', type: String, aliases: ['ve'] },
- { name: 'change-detection', type: String, aliases: ['cd'] }
+ { name: 'change-detection', type: String, aliases: ['cd'] },
+ { name: 'skip-import', type: Boolean, default: false }
],
- beforeInstall: function() {
+ beforeInstall: function(options) {
try {
this.pathToModule = findParentModule(this.project, this.dynamicPath.dir);
} catch(e) {
- throw `Error locating module for declaration\n\t${e}`;
+ if (!options.skipImport) {
+ throw `Error locating module for declaration\n\t${e}`;
+ }
}
},
@@ -139,7 +142,7 @@ module.exports = {
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
- if (!options['skip-import']) {
+ if (!options.skipImport) {
returns.push(
astUtils.addDeclarationToModule(this.pathToModule, className, importPath)
.then(change => change.apply(NodeHost)));
diff --git a/packages/angular-cli/blueprints/directive/index.js b/packages/angular-cli/blueprints/directive/index.js
index edf0af1548c3..216e115a79f6 100644
--- a/packages/angular-cli/blueprints/directive/index.js
+++ b/packages/angular-cli/blueprints/directive/index.js
@@ -13,14 +13,17 @@ module.exports = {
availableOptions: [
{ name: 'flat', type: Boolean, default: true },
{ name: 'prefix', type: Boolean, default: true },
- { name: 'spec', type: Boolean }
+ { name: 'spec', type: Boolean },
+ { name: 'skip-import', type: Boolean, default: false }
],
- beforeInstall: function() {
+ beforeInstall: function(options) {
try {
this.pathToModule = findParentModule(this.project, this.dynamicPath.dir);
} catch(e) {
- throw `Error locating module for declaration\n\t${e}`;
+ if (!options.skipImport) {
+ throw `Error locating module for declaration\n\t${e}`;
+ }
}
},
@@ -90,7 +93,7 @@ module.exports = {
const relativeDir = path.relative(moduleDir, fullGeneratePath);
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
- if (!options['skip-import']) {
+ if (!options.skipImport) {
returns.push(
astUtils.addDeclarationToModule(this.pathToModule, className, importPath)
.then(change => change.apply(NodeHost)));
diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js
index 3cd3b5646119..1ee4be43aea8 100644
--- a/packages/angular-cli/blueprints/module/index.js
+++ b/packages/angular-cli/blueprints/module/index.js
@@ -58,8 +58,12 @@ module.exports = {
},
afterInstall: function (options) {
- options.entity.name = path.relative(this.dynamicPath.appRoot, this.generatePath);
- options.flat = false;
+ // Note that `this.generatePath` already contains `this.dasherizedModuleName`
+ // So, the path will end like `name/name`,
+ // which is correct for `name.component.ts` created in module `name`
+ var componentPath = path.join(this.generatePath, this.dasherizedModuleName);
+ options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath);
+ options.flat = true;
options.route = false;
options.inlineTemplate = false;
options.inlineStyle = false;
diff --git a/packages/angular-cli/blueprints/ng2/files/.editorconfig b/packages/angular-cli/blueprints/ng2/files/.editorconfig
index 06dde115f57e..6e87a003da89 100644
--- a/packages/angular-cli/blueprints/ng2/files/.editorconfig
+++ b/packages/angular-cli/blueprints/ng2/files/.editorconfig
@@ -9,5 +9,5 @@ insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
-max_line_length = 0
+max_line_length = off
trim_trailing_whitespace = false
diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json
index c3e7995715a3..464ed3361e0a 100644
--- a/packages/angular-cli/blueprints/ng2/files/package.json
+++ b/packages/angular-cli/blueprints/ng2/files/package.json
@@ -12,33 +12,33 @@
},
"private": true,
"dependencies": {
- "@angular/common": "^2.1.0",
- "@angular/compiler": "^2.1.0",
- "@angular/core": "^2.1.0",
- "@angular/forms": "^2.1.0",
- "@angular/http": "^2.1.0",
- "@angular/platform-browser": "^2.1.0",
- "@angular/platform-browser-dynamic": "^2.1.0",
- "@angular/router": "^3.1.0",
+ "@angular/common": "2.2.1",
+ "@angular/compiler": "2.2.1",
+ "@angular/core": "2.2.1",
+ "@angular/forms": "2.2.1",
+ "@angular/http": "2.2.1",
+ "@angular/platform-browser": "2.2.1",
+ "@angular/platform-browser-dynamic": "2.2.1",
+ "@angular/router": "3.2.1",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {<% if(isMobile) { %>
- "@angular/platform-server": "~2.1.0",
+ "@angular/platform-server": "2.2.1",
"@angular/service-worker": "0.2.0",
"@angular/app-shell": "0.0.0",
"angular2-universal":"0.104.5",
"angular2-universal-polyfills": "0.4.1",
"preboot": "2.1.2",
"parse5": "1.5.1",<% } %>
- "@angular/compiler-cli": "^2.1.0",
- "@types/jasmine": "^2.2.30",
+ "@angular/compiler-cli": "2.2.1",
+ "@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "<%= version %>",
"codelyzer": "~1.0.0-beta.3",
- "jasmine-core": "2.4.1",
+ "jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
diff --git a/packages/angular-cli/blueprints/pipe/index.js b/packages/angular-cli/blueprints/pipe/index.js
index 2fa51ddad727..e4d80411732e 100644
--- a/packages/angular-cli/blueprints/pipe/index.js
+++ b/packages/angular-cli/blueprints/pipe/index.js
@@ -12,14 +12,17 @@ module.exports = {
availableOptions: [
{ name: 'flat', type: Boolean, default: true },
- { name: 'spec', type: Boolean }
+ { name: 'spec', type: Boolean },
+ { name: 'skip-import', type: Boolean, default: false }
],
- beforeInstall: function() {
+ beforeInstall: function(options) {
try {
this.pathToModule = findParentModule(this.project, this.dynamicPath.dir);
} catch(e) {
- throw `Error locating module for declaration\n\t${e}`;
+ if (!options.skipImport) {
+ throw `Error locating module for declaration\n\t${e}`;
+ }
}
},
@@ -78,7 +81,7 @@ module.exports = {
const relativeDir = path.relative(moduleDir, fullGeneratePath);
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
- if (!options['skip-import']) {
+ if (!options.skipImport) {
returns.push(
astUtils.addDeclarationToModule(this.pathToModule, className, importPath)
.then(change => change.apply(NodeHost)));
diff --git a/packages/angular-cli/blueprints/route-test/index.js b/packages/angular-cli/blueprints/route-test/index.js
deleted file mode 100644
index 0fbcb7230a14..000000000000
--- a/packages/angular-cli/blueprints/route-test/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = {
- description: '',
-
- // ******************************************************
- // ******************************************************
- // LEAVE THIS HERE
- // Must override install to prevent ember's route tests
- // ******************************************************
- // ******************************************************
-
- install: function () {
- }
-};
diff --git a/packages/angular-cli/blueprints/route/index.js b/packages/angular-cli/blueprints/route/index.js
deleted file mode 100644
index 9b3d9554bb67..000000000000
--- a/packages/angular-cli/blueprints/route/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- description: '',
-
- install: function () {
- throw 'Due to changes in the router, route generation has been temporarily disabled. You can find more information about the new router here: http://victorsavkin.com/post/145672529346/angular-router';
- }
-};
diff --git a/packages/angular-cli/blueprints/service-test/index.js b/packages/angular-cli/blueprints/service-test/index.js
deleted file mode 100644
index d0dfac69a3ab..000000000000
--- a/packages/angular-cli/blueprints/service-test/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = {
- description: '',
-
- // ******************************************************
- // ******************************************************
- // LEAVE THIS HERE
- // Must override install to prevent ember's service tests
- // ******************************************************
- // ******************************************************
-
- install: function () {
- }
-};
diff --git a/packages/angular-cli/commands/build.ts b/packages/angular-cli/commands/build.ts
index a9ed8c3ee9cf..843fa466f79d 100644
--- a/packages/angular-cli/commands/build.ts
+++ b/packages/angular-cli/commands/build.ts
@@ -11,6 +11,7 @@ export interface BuildOptions {
supressSizes: boolean;
baseHref?: string;
aot?: boolean;
+ sourcemap?: boolean;
}
const BuildCommand = Command.extend({
@@ -31,7 +32,8 @@ const BuildCommand = Command.extend({
{ name: 'watcher', type: String },
{ name: 'suppress-sizes', type: Boolean, default: false },
{ name: 'base-href', type: String, default: null, aliases: ['bh'] },
- { name: 'aot', type: Boolean, default: false }
+ { name: 'aot', type: Boolean, default: false },
+ { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] }
],
run: function (commandOptions: BuildOptions) {
diff --git a/packages/angular-cli/commands/github-pages-deploy.ts b/packages/angular-cli/commands/github-pages-deploy.ts
index 6eb35fc73e37..eb4f806e4f32 100644
--- a/packages/angular-cli/commands/github-pages-deploy.ts
+++ b/packages/angular-cli/commands/github-pages-deploy.ts
@@ -240,7 +240,7 @@ const githubPagesDeployCommand = Command.extend({
.then((stdout) => {
let match = stdout.match(/origin\s+(?:https:\/\/|git@)github\.com(?:\:|\/)([^\/]+)/m);
let userName = match[1].toLowerCase();
- let url = `https://${userName}.github.io/${options.userPage ? '' : (projectName + '/')}`;
+ let url = `https://${userName}.github.io/${options.userPage ? '' : (baseHref + '/')}`;
ui.writeLine(chalk.green(`Deployed! Visit ${url}`));
ui.writeLine('Github pages might take a few minutes to show the deployed site.');
});
diff --git a/packages/angular-cli/commands/serve.ts b/packages/angular-cli/commands/serve.ts
index fc7d6ded01ff..4b19b651edb1 100644
--- a/packages/angular-cli/commands/serve.ts
+++ b/packages/angular-cli/commands/serve.ts
@@ -26,6 +26,7 @@ export interface ServeTaskOptions {
sslKey?: string;
sslCert?: string;
aot?: boolean;
+ sourcemap?: boolean;
open?: boolean;
}
@@ -81,6 +82,7 @@ const ServeCommand = Command.extend({
{ name: 'ssl-key', type: String, default: 'ssl/server.key' },
{ name: 'ssl-cert', type: String, default: 'ssl/server.crt' },
{ name: 'aot', type: Boolean, default: false },
+ { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] },
{
name: 'open',
type: Boolean,
diff --git a/packages/angular-cli/commands/test.ts b/packages/angular-cli/commands/test.ts
index 957618d48058..cd4e23c87e21 100644
--- a/packages/angular-cli/commands/test.ts
+++ b/packages/angular-cli/commands/test.ts
@@ -2,6 +2,21 @@ const TestCommand = require('../ember-cli/lib/commands/test');
import TestTask from '../tasks/test';
import {CliConfig} from '../models/config';
+export interface TestOptions {
+ watch?: boolean;
+ codeCoverage?: boolean;
+ lint?: boolean;
+ singleRun?: boolean;
+ browsers?: string;
+ colors?: boolean;
+ log?: string;
+ port?: number;
+ reporters?: string;
+ build?: boolean;
+ sourcemap?: boolean;
+}
+
+
const NgCliTestCommand = TestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
@@ -13,10 +28,11 @@ const NgCliTestCommand = TestCommand.extend({
{ name: 'log-level', type: String },
{ name: 'port', type: Number },
{ name: 'reporters', type: String },
- { name: 'build', type: Boolean, default: true }
+ { name: 'build', type: Boolean, default: true },
+ { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] }
],
- run: function(commandOptions: any) {
+ run: function(commandOptions: TestOptions) {
this.project.ngConfig = this.project.ngConfig || CliConfig.fromProject();
const testTask = new TestTask({
diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts
index 6d1bbe01c76f..d81e3c44ebb1 100644
--- a/packages/angular-cli/models/webpack-build-common.ts
+++ b/packages/angular-cli/models/webpack-build-common.ts
@@ -11,7 +11,8 @@ export function getWebpackCommonConfig(
projectRoot: string,
environment: string,
appConfig: any,
- baseHref: string
+ baseHref: string,
+ sourcemap: boolean
) {
const appRoot = path.resolve(projectRoot, appConfig.root);
@@ -32,7 +33,7 @@ export function getWebpackCommonConfig(
if (appConfig.scripts.length > 0) { entry['scripts'] = scripts; }
return {
- devtool: 'source-map',
+ devtool: sourcemap ? 'source-map' : 'eval',
resolve: {
extensions: ['.ts', '.js'],
modules: [path.resolve(projectRoot, 'node_modules')]
@@ -41,7 +42,9 @@ export function getWebpackCommonConfig(
entry: entry,
output: {
path: path.resolve(projectRoot, appConfig.outDir),
- filename: '[name].bundle.js'
+ filename: '[name].bundle.js',
+ sourceMapFilename: '[name].bundle.map',
+ chunkFilename: '[id].chunk.js'
},
module: {
rules: [
@@ -80,7 +83,7 @@ export function getWebpackCommonConfig(
{ test: /\.(jpg|png|gif)$/, loader: 'url-loader?limit=10000' },
{ test: /\.html$/, loader: 'raw-loader' },
- { test: /\.(otf|ttf|woff|woff2)$/, loader: 'url?limit=10000' },
+ { test: /\.(otf|ttf|woff|woff2)$/, loader: 'url-loader?limit=10000' },
{ test: /\.(eot|svg)$/, loader: 'file-loader' }
]
},
diff --git a/packages/angular-cli/models/webpack-build-development.ts b/packages/angular-cli/models/webpack-build-development.ts
index c36760fab3bc..d38748abdf2a 100644
--- a/packages/angular-cli/models/webpack-build-development.ts
+++ b/packages/angular-cli/models/webpack-build-development.ts
@@ -7,11 +7,10 @@ export const getWebpackDevConfigPartial = function(projectRoot: string, appConfi
: [];
const cssLoaders = ['style-loader', 'css-loader?sourcemap', 'postcss-loader'];
return {
- devtool: 'source-map',
output: {
path: path.resolve(projectRoot, appConfig.outDir),
filename: '[name].bundle.js',
- sourceMapFilename: '[name].map',
+ sourceMapFilename: '[name].bundle.map',
chunkFilename: '[id].chunk.js'
},
module: {
diff --git a/packages/angular-cli/models/webpack-build-production.ts b/packages/angular-cli/models/webpack-build-production.ts
index e925035a7395..0d52a86a4678 100644
--- a/packages/angular-cli/models/webpack-build-production.ts
+++ b/packages/angular-cli/models/webpack-build-production.ts
@@ -21,7 +21,6 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
: [];
const cssLoaders = ['css-loader?sourcemap&minimize', 'postcss-loader'];
return {
- devtool: 'source-map',
output: {
path: path.resolve(projectRoot, appConfig.outDir),
filename: '[name].[chunkhash].bundle.js',
diff --git a/packages/angular-cli/models/webpack-build-test.js b/packages/angular-cli/models/webpack-build-test.js
index b0b2aae4bf63..8361c87a00b4 100644
--- a/packages/angular-cli/models/webpack-build-test.js
+++ b/packages/angular-cli/models/webpack-build-test.js
@@ -43,7 +43,7 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig, test
}
return {
- devtool: 'inline-source-map',
+ devtool: testConfig.sourcemap ? 'inline-source-map' : 'eval',
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.ts', '.js'],
diff --git a/packages/angular-cli/models/webpack-config.ts b/packages/angular-cli/models/webpack-config.ts
index 6317fef937a3..a6c42a8ba407 100644
--- a/packages/angular-cli/models/webpack-config.ts
+++ b/packages/angular-cli/models/webpack-config.ts
@@ -23,7 +23,8 @@ export class NgCliWebpackConfig {
public environment: string,
outputDir?: string,
baseHref?: string,
- isAoT = false
+ isAoT = false,
+ sourcemap = true,
) {
const config: CliConfig = CliConfig.fromProject();
const appConfig = config.config.apps[0];
@@ -34,7 +35,8 @@ export class NgCliWebpackConfig {
this.ngCliProject.root,
environment,
appConfig,
- baseHref
+ baseHref,
+ sourcemap
);
let targetConfigPartial = this.getTargetConfig(this.ngCliProject.root, appConfig);
const typescriptConfigPartial = isAoT
diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json
index 8235fe502dc3..b31db9bbde02 100644
--- a/packages/angular-cli/package.json
+++ b/packages/angular-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-cli",
- "version": "1.0.0-beta.20-1",
+ "version": "1.0.0-beta.21",
"description": "CLI tool for Angular",
"main": "lib/cli/index.js",
"trackingCode": "UA-8594346-19",
@@ -27,7 +27,10 @@
"dependencies": {
"@angular-cli/ast-tools": "^1.0.1",
"@angular-cli/base-href-webpack": "^1.0.0",
- "@ngtools/webpack": "latest",
+ "@angular/compiler": "2.2.1",
+ "@angular/compiler-cli": "2.2.1",
+ "@angular/core": "2.2.1",
+ "@ngtools/webpack": "^1.0.0",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^2.2.3",
"chalk": "^1.1.3",
@@ -82,6 +85,7 @@
"quick-temp": "0.1.5",
"raw-loader": "^0.5.1",
"readline2": "0.1.1",
+ "reflect-metadata": "^0.1.8",
"remap-istanbul": "^0.6.4",
"resolve": "^1.1.7",
"rimraf": "^2.5.3",
diff --git a/packages/angular-cli/plugins/karma.js b/packages/angular-cli/plugins/karma.js
index 983157f3fdca..4f8ff7088ac9 100644
--- a/packages/angular-cli/plugins/karma.js
+++ b/packages/angular-cli/plugins/karma.js
@@ -12,7 +12,8 @@ const init = (config) => {
const environment = config.angularCli.environment || 'dev';
const testConfig = {
codeCoverage: config.angularCli.codeCoverage || false,
- lint: config.angularCli.lint || false
+ lint: config.angularCli.lint || false,
+ sourcemap: config.angularCli.sourcemap
}
// add webpack config
diff --git a/packages/angular-cli/tasks/build-webpack-watch.ts b/packages/angular-cli/tasks/build-webpack-watch.ts
index 45a1f6e55a55..ab7498b3dc00 100644
--- a/packages/angular-cli/tasks/build-webpack-watch.ts
+++ b/packages/angular-cli/tasks/build-webpack-watch.ts
@@ -24,7 +24,8 @@ export default Task.extend({
runTaskOptions.environment,
outputDir,
runTaskOptions.baseHref,
- runTaskOptions.aot
+ runTaskOptions.aot,
+ runTaskOptions.sourcemap
).config;
const webpackCompiler: any = webpack(config);
diff --git a/packages/angular-cli/tasks/build-webpack.ts b/packages/angular-cli/tasks/build-webpack.ts
index e47564863eeb..a2bd60c5c608 100644
--- a/packages/angular-cli/tasks/build-webpack.ts
+++ b/packages/angular-cli/tasks/build-webpack.ts
@@ -23,7 +23,8 @@ export default Task.extend({
runTaskOptions.environment,
outputDir,
runTaskOptions.baseHref,
- runTaskOptions.aot
+ runTaskOptions.aot,
+ runTaskOptions.sourcemap
).config;
const webpackCompiler: any = webpack(config);
diff --git a/packages/angular-cli/tasks/serve-webpack.ts b/packages/angular-cli/tasks/serve-webpack.ts
index 798d4e38f69a..5f8a98980966 100644
--- a/packages/angular-cli/tasks/serve-webpack.ts
+++ b/packages/angular-cli/tasks/serve-webpack.ts
@@ -26,7 +26,8 @@ export default Task.extend({
commandOptions.environment,
undefined,
undefined,
- commandOptions.aot
+ commandOptions.aot,
+ commandOptions.sourcemap
).config;
// This allows for live reload of page when changes are made to repo.
diff --git a/packages/angular-cli/tasks/test.ts b/packages/angular-cli/tasks/test.ts
index 56ba9e1c1d87..6714cf0e7601 100644
--- a/packages/angular-cli/tasks/test.ts
+++ b/packages/angular-cli/tasks/test.ts
@@ -1,4 +1,5 @@
const Task = require('../ember-cli/lib/models/task');
+import { TestOptions } from '../commands/test';
import * as path from 'path';
// require dependencies within the target project
@@ -9,27 +10,30 @@ function requireDependency(root: string, moduleName: string) {
}
export default Task.extend({
- run: function (options: any) {
+ run: function (options: TestOptions) {
const projectRoot = this.project.root;
return new Promise((resolve) => {
const karma = requireDependency(projectRoot, 'karma');
const karmaConfig = path.join(projectRoot, this.project.ngConfig.config.test.karma.config);
+ let karmaOptions: any = Object.assign({}, options);
+
// Convert browsers from a string to an array
if (options.browsers) {
- options.browsers = options.browsers.split(',');
+ karmaOptions.browsers = options.browsers.split(',');
}
- options.angularCli = {
+ karmaOptions.angularCli = {
codeCoverage: options.codeCoverage,
lint: options.lint,
+ sourcemap: options.sourcemap
};
// Assign additional karmaConfig options to the local ngapp config
- options.configFile = karmaConfig;
+ karmaOptions.configFile = karmaConfig;
// :shipit:
- const karmaServer = new karma.Server(options, resolve);
+ const karmaServer = new karma.Server(karmaOptions, resolve);
karmaServer.start();
});
}
diff --git a/packages/ast-tools/package.json b/packages/ast-tools/package.json
index 962c5df2fc57..e58bfe70ff1a 100644
--- a/packages/ast-tools/package.json
+++ b/packages/ast-tools/package.json
@@ -1,6 +1,6 @@
{
"name": "@angular-cli/ast-tools",
- "version": "1.0.7",
+ "version": "1.0.8",
"description": "CLI tool for Angular",
"main": "./src/index.js",
"keywords": [
diff --git a/packages/base-href-webpack/package.json b/packages/base-href-webpack/package.json
index aa13615244cf..1a3c29a6a901 100644
--- a/packages/base-href-webpack/package.json
+++ b/packages/base-href-webpack/package.json
@@ -1,6 +1,6 @@
{
"name": "@angular-cli/base-href-webpack",
- "version": "1.0.6",
+ "version": "1.0.7",
"description": "Base HREF Webpack plugin",
"main": "./src/index.js",
"keywords": [
diff --git a/packages/webpack/package.json b/packages/webpack/package.json
index 4e21df1d1106..169124176242 100644
--- a/packages/webpack/package.json
+++ b/packages/webpack/package.json
@@ -1,6 +1,6 @@
{
"name": "@ngtools/webpack",
- "version": "1.1.4",
+ "version": "1.1.5",
"description": "Webpack plugin that AoT compiles your Angular components and modules.",
"main": "./src/index.js",
"typings": "src/index.d.ts",
@@ -29,8 +29,8 @@
},
"peerDependencies": {
"typescript": "^2.0.2",
- "@angular/compiler-cli": "^2.1.0",
- "@angular/core": "^2.0.0",
+ "@angular/compiler-cli": "2.2.1",
+ "@angular/core": "2.2.1",
"reflect-metadata": "^0.1.8"
}
}
diff --git a/tests/e2e/assets/webpack/test-app/package.json b/tests/e2e/assets/webpack/test-app/package.json
index 3c53508c260d..3820b8170840 100644
--- a/tests/e2e/assets/webpack/test-app/package.json
+++ b/tests/e2e/assets/webpack/test-app/package.json
@@ -2,15 +2,15 @@
"name": "test",
"license": "MIT",
"dependencies": {
- "@angular/common": "~2.1.0",
- "@angular/compiler": "~2.1.0",
- "@angular/compiler-cli": "~2.1.0",
- "@angular/core": "~2.1.0",
- "@angular/http": "~2.1.0",
- "@angular/platform-browser": "~2.1.0",
- "@angular/platform-browser-dynamic": "~2.1.0",
- "@angular/platform-server": "~2.1.0",
- "@angular/router": "~3.1.0",
+ "@angular/common": "2.2.1",
+ "@angular/compiler": "2.2.1",
+ "@angular/compiler-cli": "2.2.1",
+ "@angular/core": "2.2.1",
+ "@angular/http": "2.2.1",
+ "@angular/platform-browser": "2.2.1",
+ "@angular/platform-browser-dynamic": "2.2.1",
+ "@angular/platform-server": "2.2.1",
+ "@angular/router": "3.2.1",
"core-js": "^2.4.1",
"rxjs": "^5.0.0-beta.12",
"zone.js": "^0.6.21"
diff --git a/tests/e2e/tests/build/sourcemap.ts b/tests/e2e/tests/build/sourcemap.ts
new file mode 100644
index 000000000000..7029ff872f24
--- /dev/null
+++ b/tests/e2e/tests/build/sourcemap.ts
@@ -0,0 +1,11 @@
+import {ng} from '../../utils/process';
+import {expectFileToExist} from '../../utils/fs';
+import {expectToFail} from '../../utils/utils';
+
+
+export default function() {
+ return ng('build')
+ .then(() => expectFileToExist('dist/main.bundle.map'))
+ .then(() => ng('build', '--no-sourcemap'))
+ .then(() => expectToFail(() => expectFileToExist('dist/main.bundle.map')));
+}
diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts
index 2ba3dfc06313..071c20f3bea7 100644
--- a/tests/e2e/tests/generate/module/module-basic.ts
+++ b/tests/e2e/tests/generate/module/module-basic.ts
@@ -1,6 +1,6 @@
import {join} from 'path';
import {ng} from '../../../utils/process';
-import {expectFileToExist} from '../../../utils/fs';
+import {expectFileToExist, expectFileToMatch} from '../../../utils/fs';
import {expectToFail} from '../../../utils/utils';
@@ -15,6 +15,7 @@ export default function() {
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts')))
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.html')))
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.css')))
+ .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleComponent'))
// Try to run the unit tests.
.then(() => ng('test', '--single-run'));