diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f3a14e..2e330a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ 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. + +## [0.2.1](https://github.com/webpack/source-map-loader/compare/v0.2.0...v0.2.1) (2017-03-30) + + +### Bug Fixes + +* Regex does not work for minified artifact of style-loader ([#39](https://github.com/webpack/source-map-loader/issues/39)) ([582f8dc](https://github.com/webpack/source-map-loader/commit/582f8dc)) + + + # [0.2.0](https://github.com/webpack/source-map-loader/compare/v0.1.6...v0.2.0) (2017-03-10) diff --git a/index.js b/index.js index 49a0960..25713fa 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ var async = require("async"); var loaderUtils = require("loader-utils"); // Matches only the last occurrence of sourceMappingURL -var baseRegex = "\\s*[@#]\\s*sourceMappingURL\\s*=\\s*([^\\s]*)(?![\S\s]*sourceMappingURL)", +var baseRegex = "\\s*[@#]\\s*sourceMappingURL\\s*=\\s*([^\\s]*)(?![\\S\\s]*sourceMappingURL)", // Matches /* ... */ comments regex1 = new RegExp("/\\*"+baseRegex+"\\s*\\*/"), // Matches // .... comments diff --git a/package.json b/package.json index 029d11c..dd76bc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "source-map-loader", - "version": "0.2.0", + "version": "0.2.1", "author": "Tobias Koppers @sokra", "description": "extracts inlined source map and offers it to webpack", "scripts": { diff --git a/test/fixtures/multi-source-map.js b/test/fixtures/multi-source-map.js index 9abb042..f844435 100644 --- a/test/fixtures/multi-source-map.js +++ b/test/fixtures/multi-source-map.js @@ -1,4 +1,4 @@ with SourceMap -anInvalidDirective = "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; +anInvalidDirective = "\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"; // @ sourceMappingURL = data:application/source-map;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzIjpbImlubGluZS1zb3VyY2UtbWFwLnR4dCJdLCJzb3VyY2VzQ29udGVudCI6WyJ3aXRoIFNvdXJjZU1hcCJdLCJtYXBwaW5ncyI6IkFBQUEifQ== // comment \ No newline at end of file diff --git a/test/index.test.js b/test/index.test.js index 2ea48cd..ed0543b 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -113,7 +113,7 @@ describe("source-map-loader", function() { execLoader(path.join(__dirname, "fixtures", "multi-source-map.js"), function (err, res, map, deps, warns) { should.equal(err, null); warns.should.be.eql([]); - should.equal(res, "with SourceMap\nanInvalidDirective = \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n// comment"), + should.equal(res, "with SourceMap\nanInvalidDirective = \"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+\" */\";\n// comment"), map.should.be.eql({ "version": 3, "file": "inline-source-map.js",