Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/cli): sourcemaps should be the main option, sourcemap an alias #5422

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@angular/cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const baseBuildCommandOptions: any = [
description: 'Build using Ahead of Time compilation.'
},
{
name: 'sourcemap',
name: 'sourcemaps',
type: Boolean,
aliases: ['sm', 'sourcemaps'],
aliases: ['sm', 'sourcemap'],
description: 'Output sourcemaps.'
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/@angular/cli/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface TestOptions {
log?: string;
port?: number;
reporters?: string;
sourcemap?: boolean;
sourcemaps?: boolean;
progress?: boolean;
config: string;
poll?: number;
Expand Down Expand Up @@ -85,10 +85,10 @@ const TestCommand = EmberTestCommand.extend({
description: 'List of reporters to use.'
},
{
name: 'sourcemap',
name: 'sourcemaps',
type: Boolean,
default: true,
aliases: ['sm'],
aliases: ['sm', 'sourcemap'],
description: 'Output sourcemaps.'
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/build-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface BuildOptions {
environment?: string;
outputPath?: string;
aot?: boolean;
sourcemap?: boolean;
sourcemaps?: boolean;
vendorChunk?: boolean;
baseHref?: string;
deployUrl?: string;
Expand Down
8 changes: 4 additions & 4 deletions packages/@angular/cli/models/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ export class NgCliWebpackConfig {
}

// Fill in defaults for build targets
public addTargetDefaults(buildOptions: BuildOptions) {
const targetDefaults: any = {
public addTargetDefaults(buildOptions: BuildOptions): BuildOptions {
const targetDefaults: { [target: string]: BuildOptions } = {
development: {
environment: 'dev',
outputHashing: 'media',
sourcemap: true,
sourcemaps: true,
extractCss: false
},
production: {
environment: 'prod',
outputHashing: 'all',
sourcemap: false,
sourcemaps: false,
extractCss: true,
aot: true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
}

return {
devtool: buildOptions.sourcemap ? 'source-map' : false,
devtool: buildOptions.sourcemaps ? 'source-map' : false,
resolve: {
extensions: ['.ts', '.js'],
modules: [nodeModules],
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-configs/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
new webpack.optimize.UglifyJsPlugin(<any>{
mangle: { screw_ie8: true },
compress: { screw_ie8: true, warnings: buildOptions.verbose },
sourceMap: buildOptions.sourcemap
sourceMap: buildOptions.sourcemaps
})
].concat(extraPlugins)
};
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-configs/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
// style-loader does not support sourcemaps without absolute publicPath, so it's
// better to disable them when not extracting css
// https://github.com/webpack-contrib/style-loader#recommended-configuration
const cssSourceMap = buildOptions.extractCss && buildOptions.sourcemap;
const cssSourceMap = buildOptions.extractCss && buildOptions.sourcemaps;

// Minify/optimize css in production.
const cssnanoPlugin = cssnano({ safe: true, autoprefixer: false });
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-configs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function getTestConfig(testConfig: WebpackTestOptions) {
}

return {
devtool: testConfig.sourcemap ? 'inline-source-map' : 'eval',
devtool: testConfig.sourcemaps ? 'inline-source-map' : 'eval',
entry: {
test: path.resolve(projectRoot, appConfig.root, appConfig.test)
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/plugins/karma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const init: any = (config: any) => {
const testConfig: WebpackTestOptions = Object.assign({
environment: 'dev',
codeCoverage: false,
sourcemap: true,
sourcemaps: true,
progress: true,
}, config.angularCli);

Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/tasks/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default Task.extend({

karmaOptions.angularCli = {
codeCoverage: options.codeCoverage,
sourcemap: options.sourcemap,
sourcemap: options.sourcemaps,
progress: options.progress,
poll: options.poll,
app: options.app
Expand Down