Skip to content

Commit

Permalink
Allow configuration of webpack rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ScallyGames committed Feb 21, 2017
1 parent a4b43a5 commit f3cfdb8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/@angular/cli/lib/config/schema.json
Expand Up @@ -106,6 +106,23 @@
"type": "boolean",
"default": false
},
"loaderRules": {
"description": "Array of matching rules extending the default webpack configuration.",
"type": "array",
"items": {
"type": "object",
"properties": {
"test": {
"type": "string"
},
"loader": {
"type": "string"
}
},
"required": ["test", "loader"],
"additionalProperties": false
}
},
"styles": {
"description": "Global styles to be included in the build.",
"type": "array",
Expand Down
4 changes: 3 additions & 1 deletion packages/@angular/cli/models/webpack-configs/common.ts
Expand Up @@ -30,7 +30,9 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
const nodeModules = path.resolve(projectRoot, 'node_modules');

let extraPlugins: any[] = [];
let extraRules: any[] = [];
let extraRules: any[] = appConfig.loaderRules.map((entry: any) => {
return { test: new RegExp(entry.test), loader: entry.loader };
}) || [];
let entryPoints: { [key: string]: string[] } = {};

// figure out which are the lazy loaded entry points
Expand Down

0 comments on commit f3cfdb8

Please sign in to comment.