Skip to content

Introduce tslint npm script task #1835

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

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes for
(max-line-length) addon/ng2/models/webpack-config.ts[21, 1]: Exceeds maximum line length of 100
(max-line-length) addon/ng2/models/webpack-config.ts[32, 1]: Exceeds maximum line length of 100
(max-line-length) addon/ng2/models/webpack-config.ts[33, 1]: Exceeds maximum line length of 100
(max-line-length) addon/ng2/models/webpack-config.ts[34, 1]: Exceeds maximum line length of 100
(max-line-length) addon/ng2/models/webpack-config.ts[35, 1]: Exceeds maximum line length of 100
(one-line) addon/ng2/models/webpack-config.ts[31, 26]: missing whitespace
(quotemark) addon/ng2/models/webpack-config.ts[43, 12]: " should be '
(quotemark) addon/ng2/models/webpack-config.ts[46, 12]: " should be '
  • Loading branch information
catull committed Aug 25, 2016
commit cb407bb75d7870a9d40786f71c6d11cfa89dedaa
22 changes: 13 additions & 9 deletions addon/ng2/models/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class NgCliWebpackConfig {
private webpackMobileConfigPartial: any;
private webpackMobileProdConfigPartial: any;

constructor(public ngCliProject: any, public target: string, public environment: string, outputDir?: string) {
constructor(public ngCliProject: any, public target: string, public environment: string,
outputDir?: string) {
const config: CliConfig = CliConfig.fromProject();
const appConfig = config.config.apps[0];

Expand All @@ -28,27 +29,30 @@ export class NgCliWebpackConfig {
this.webpackDevConfigPartial = getWebpackDevConfigPartial(this.ngCliProject.root, appConfig);
this.webpackProdConfigPartial = getWebpackProdConfigPartial(this.ngCliProject.root, appConfig);

if (appConfig.mobile){
this.webpackMobileConfigPartial = getWebpackMobileConfigPartial(this.ngCliProject.root, appConfig);
this.webpackMobileProdConfigPartial = getWebpackMobileProdConfigPartial(this.ngCliProject.root, appConfig);
this.webpackBaseConfig = webpackMerge(this.webpackBaseConfig, this.webpackMobileConfigPartial);
this.webpackProdConfigPartial = webpackMerge(this.webpackProdConfigPartial, this.webpackMobileProdConfigPartial);
if (appConfig.mobile) {
this.webpackMobileConfigPartial = getWebpackMobileConfigPartial(this.ngCliProject.root,
appConfig);
this.webpackMobileProdConfigPartial = getWebpackMobileProdConfigPartial(
this.ngCliProject.root, appConfig);
this.webpackBaseConfig = webpackMerge(this.webpackBaseConfig,
this.webpackMobileConfigPartial);
this.webpackProdConfigPartial = webpackMerge(this.webpackProdConfigPartial,
this.webpackMobileProdConfigPartial);
}

this.generateConfig();
}

generateConfig(): void {
switch (this.target) {
case "development":
case 'development':
this.config = webpackMerge(this.webpackBaseConfig, this.webpackDevConfigPartial);
break;
case "production":
case 'production':
this.config = webpackMerge(this.webpackBaseConfig, this.webpackProdConfigPartial);
break;
default:
throw new Error("Invalid build target. Only 'development' and 'production' are available.");
break;
}
}
}