Skip to content

Commit

Permalink
fix(@angular/cli): update file-loader and url-loader
Browse files Browse the repository at this point in the history
This should fix errors like the one below for 0.6.0:
```
URL Loader Invalid Options

options['name'] should NOT have additional properties
options.limit should be number
```
  • Loading branch information
filipesilva committed Oct 18, 2017
1 parent d860591 commit 6b22d4d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"enhanced-resolve": "^3.4.1",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "3.0.0",
"file-loader": "^0.10.0",
"file-loader": "^1.1.5",
"fs-extra": "^4.0.0",
"glob": "^7.0.3",
"html-webpack-plugin": "^2.29.0",
Expand Down Expand Up @@ -92,7 +92,7 @@
"tree-kill": "^1.0.0",
"typescript": "~2.4.2",
"uglifyjs-webpack-plugin": "1.0.0-beta.1",
"url-loader": "^0.6.0",
"url-loader": "^0.6.2",
"webpack": "~3.7.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-middleware": "~1.12.0",
Expand Down
15 changes: 13 additions & 2 deletions packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,21 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
module: {
rules: [
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.(eot|svg|cur)$/, loader: `file-loader?name=[name]${hashFormat.file}.[ext]` },
{
test: /\.(eot|svg|cur)$/,
loader: 'file-loader',
options: {
name: `[name]${hashFormat.file}.[ext]`,
limit: 10000
}
},
{
test: /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/,
loader: `url-loader?name=[name]${hashFormat.file}.[ext]&limit=10000`
loader: 'url-loader',
options: {
name: `[name]${hashFormat.file}`,
limit: 10000
}
}
].concat(extraRules)
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ember-cli-string-utils": "^1.0.0",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "3.0.0",
"file-loader": "^0.10.0",
"file-loader": "^1.1.5",
"fs-extra": "^4.0.0",
"glob": "^7.0.3",
"html-webpack-plugin": "^2.29.0",
Expand Down Expand Up @@ -75,7 +75,7 @@
"stylus-loader": "^3.0.1",
"typescript": ">=2.0.0 <2.6.0",
"uglifyjs-webpack-plugin": "1.0.0-beta.1",
"url-loader": "^0.6.0",
"url-loader": "^0.6.2",
"webpack": "~3.7.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-middleware": "~1.12.0",
Expand Down

0 comments on commit 6b22d4d

Please sign in to comment.