css-loader 3.4.0 → 3.4.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,6 +2,14 @@
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
+ ### [3.4.1](https://github.com/webpack-contrib/css-loader/compare/v3.4.0...v3.4.1) (2020-01-03)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * do not output `undefined` when sourceRoot is unavailable ([#1036](https://github.com/webpack-contrib/css-loader/issues/1036)) ([ded2a79](https://github.com/webpack-contrib/css-loader/commit/ded2a797271f2adf864bf92300621c024974bc79))
11
+ * don't output invalid es5 code when locals do not exists ([#1035](https://github.com/webpack-contrib/css-loader/issues/1035)) ([b60e62a](https://github.com/webpack-contrib/css-loader/commit/b60e62a655719cc1779fae7d577af6ad6cf42135))
12
+
5
13
  ## [3.4.0](https://github.com/webpack-contrib/css-loader/compare/v3.3.1...v3.4.0) (2019-12-17)
6
14
 
7
15
 
@@ -59,7 +59,7 @@ function cssWithMappingToString(item, useSourceMap) {
59
59
  if (useSourceMap && typeof btoa === 'function') {
60
60
  var sourceMapping = toComment(cssMapping);
61
61
  var sourceURLs = cssMapping.sources.map(function (source) {
62
- return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
62
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
63
63
  });
64
64
  return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
65
65
  }
package/dist/utils.js CHANGED
@@ -384,7 +384,7 @@ function getExportCode(loaderContext, exports, exportType, replacers, localsConv
384
384
  }
385
385
 
386
386
  if (exportType === 'locals') {
387
- exportItems.push(`${esModule ? 'export default' : 'module.exports ='} {\n${exportLocalsCode}\n};`);
387
+ exportItems.push(`${esModule ? 'export default' : 'module.exports ='} ${exportLocalsCode ? `{\n${exportLocalsCode}\n}` : '{}'};`);
388
388
  } else {
389
389
  if (exportLocalsCode) {
390
390
  exportItems.push(`exports.locals = {\n${exportLocalsCode}\n};`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-loader",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "css loader module for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/css-loader",