css-loader 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,9 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="1.0.1"></a>
6
+ ## [1.0.1](https://github.com/webpack-contrib/css-loader/compare/v1.0.0...v1.0.1) (2018-10-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **loader:** trim unquoted import urls ([#783](https://github.com/webpack-contrib/css-loader/issues/783)) ([21fcddf](https://github.com/webpack-contrib/css-loader/commit/21fcddf))
12
+
13
+
14
+
5
15
  <a name="1.0.0"></a>
6
16
  # [1.0.0](https://github.com/webpack-contrib/css-loader/compare/v0.28.11...v1.0.0) (2018-07-06)
7
17
 
18
+
8
19
  ### BREAKING CHANGES
9
20
 
10
21
  * remove `minimize` option, use [`postcss-loader`](https://github.com/postcss/postcss-loader) with [`cssnano`](https://github.com/cssnano/cssnano) or use [`optimize-cssnano-plugin`](https://github.com/intervolga/optimize-cssnano-plugin) plugin
@@ -17,6 +28,7 @@ All notable changes to this project will be documented in this file. See [standa
17
28
  * minimum require `webpack` version is `4`
18
29
 
19
30
 
31
+
20
32
  <a name="0.28.11"></a>
21
33
  ## [0.28.11](https://github.com/webpack-contrib/css-loader/compare/v0.28.10...v0.28.11) (2018-03-16)
22
34
 
package/README.md CHANGED
@@ -50,7 +50,7 @@ module.exports = {
50
50
 
51
51
  ### `toString`
52
52
 
53
- You can also use the css-loader results directly as string, such as in Angular's component style.
53
+ You can also use the css-loader results directly as a string, such as in Angular's component style.
54
54
 
55
55
  **webpack.config.js**
56
56
  ```js
@@ -137,7 +137,7 @@ The syntax `:local(.className)` can be used to declare `className` in the local
137
137
 
138
138
  With `:local` (without brackets) local mode can be switched on for this selector. `:global(.className)` can be used to declare an explicit global selector. With `:global` (without brackets) global mode can be switched on for this selector.
139
139
 
140
- The loader replaces local selectors with unique identifiers. The choosen unique identifiers are exported by the module.
140
+ The loader replaces local selectors with unique identifiers. The chosen unique identifiers are exported by the module.
141
141
 
142
142
  ```css
143
143
  :local(.className) { background: red; }
@@ -162,7 +162,7 @@ exports.locals = {
162
162
  }
163
163
  ```
164
164
 
165
- CamelCase is recommended for local selectors. They are easier to use in the within the imported JS module.
165
+ CamelCase is recommended for local selectors. They are easier to use within the imported JS module.
166
166
 
167
167
  `url()` URLs in block scoped (`:local .abc`) rules behave like requests in modules.
168
168
 
@@ -280,9 +280,9 @@ You can also specify the absolute path to your custom `getLocalIdent` function t
280
280
 
281
281
  To include source maps set the `sourceMap` option.
282
282
 
283
- I. e. the extract-text-webpack-plugin can handle them.
283
+ I.e. the extract-text-webpack-plugin can handle them.
284
284
 
285
- They are not enabled by default because they expose a runtime overhead and increase in bundle size (JS source maps do not). In addition to that relative paths are buggy and you need to use an absolute public path which include the server URL.
285
+ They are not enabled by default because they expose a runtime overhead and increase in bundle size (JS source maps do not). In addition to that relative paths are buggy and you need to use an absolute public path which includes the server URL.
286
286
 
287
287
  **webpack.config.js**
288
288
  ```js
@@ -327,7 +327,7 @@ import { className } from 'file.css';
327
327
 
328
328
  ### `importLoaders`
329
329
 
330
- The query parameter `importLoaders` allows to configure how many loaders before `css-loader` should be applied to `@import`ed resources.
330
+ The query parameter `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@import`ed resources.
331
331
 
332
332
  **webpack.config.js**
333
333
  ```js
@@ -347,7 +347,7 @@ The query parameter `importLoaders` allows to configure how many loaders before
347
347
  }
348
348
  ```
349
349
 
350
- This may change in the future, when the module system (i. e. webpack) supports loader matching by origin.
350
+ This may change in the future when the module system (i. e. webpack) supports loader matching by origin.
351
351
 
352
352
  <h2 align="center">Examples</h2>
353
353
 
@@ -378,7 +378,7 @@ module.exports = {
378
378
 
379
379
  ### Extract
380
380
 
381
- For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
381
+ For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
382
382
  This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.
383
383
 
384
384
  <h2 align="center">Maintainers</h2>
@@ -1,4 +1,4 @@
1
- var camelCase = require("lodash.camelcase");
1
+ var camelCase = require("lodash/camelCase");
2
2
 
3
3
  function dashesCamelCase(str) {
4
4
  return str.replace(/-+(\w)/g, function(match, firstLetter) {
package/lib/loader.js CHANGED
@@ -49,7 +49,11 @@ module.exports = function(content, map) {
49
49
  var importUrlPrefix = getImportPrefix(this, query);
50
50
 
51
51
  var alreadyImported = {};
52
- var importJs = result.importItems.filter(function(imp) {
52
+ var importJs = result.importItems.map(function(imp) {
53
+ // fixes #781 when importing `url(filename.css )`
54
+ imp.url = imp.url.trim();
55
+ return imp;
56
+ }).filter(function(imp) {
53
57
  if(!imp.mediaQuery) {
54
58
  if(alreadyImported[imp.url])
55
59
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-loader",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "license": "MIT",
6
6
  "description": "css loader module for webpack",
@@ -17,7 +17,7 @@
17
17
  "css-selector-tokenizer": "^0.7.0",
18
18
  "icss-utils": "^2.1.0",
19
19
  "loader-utils": "^1.0.2",
20
- "lodash.camelcase": "^4.3.0",
20
+ "lodash": "^4.17.11",
21
21
  "postcss": "^6.0.23",
22
22
  "postcss-modules-extract-imports": "^1.2.0",
23
23
  "postcss-modules-local-by-default": "^1.2.0",