Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion packages/@angular/cli/models/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
getProdConfig,
getStylesConfig,
getNonAotConfig,
getAotConfig
getAotConfig,
getCustomConfig
} from './webpack-configs';

const path = require('path');
Expand Down Expand Up @@ -51,6 +52,8 @@ export class NgCliWebpackConfig {
webpackConfigs.push(typescriptConfigPartial);
}

webpackConfigs.push(getCustomConfig(this.wco));

this.config = webpackMerge(webpackConfigs);
return this.config;
}
Expand Down
14 changes: 14 additions & 0 deletions packages/@angular/cli/models/webpack-configs/custom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as fs from 'fs';
import * as path from 'path';

import { WebpackConfigOptions } from '../webpack-config';

export const getCustomConfig = function (_wco: WebpackConfigOptions) {
const customConfigPath = path.join(_wco.projectRoot, 'webpack.config.js');

if (fs.existsSync(customConfigPath)) {
return require(customConfigPath);
}

return {};
};
1 change: 1 addition & 0 deletions packages/@angular/cli/models/webpack-configs/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './browser';
export * from './common';
export * from './custom';
export * from './development';
export * from './production';
export * from './styles';
Expand Down