diff --git a/lib/index.js b/lib/index.js index 4e035720..d876c069 100644 --- a/lib/index.js +++ b/lib/index.js @@ -103,7 +103,6 @@ module.exports = function loader (css, map, meta) { let plugins = config.plugins || [] let options = Object.assign({ - to: file, from: file, map: sourceMap ? sourceMap === 'inline' diff --git a/test/options/__snapshots__/sourceMap.test.js.snap b/test/options/__snapshots__/sourceMap.test.js.snap index 46440cb8..63c09174 100644 --- a/test/options/__snapshots__/sourceMap.test.js.snap +++ b/test/options/__snapshots__/sourceMap.test.js.snap @@ -4,11 +4,11 @@ exports[`Options Sourcemap - {Boolean} 1`] = `"module.exports = \\"a { color: rg exports[`Options Sourcemap - {Boolean} 2`] = ` Object { - "file": "../../style.css", + "file": "../fixtures/css/style.css", "mappings": "AAAA,IAAI,2BAAY,EAAE", "names": Array [], "sources": Array [ - "../../style.css", + "../fixtures/css/style.css", ], "sourcesContent": Array [ "a { color: black } @@ -18,4 +18,4 @@ Object { } `; -exports[`Options Sourcemap - {String} 1`] = `"module.exports = \\"a { color: rgba(255, 0, 0, 1.0) }\\\\n\\\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLDJCQUFZLEVBQUUiLCJmaWxlIjoic3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYSB7IGNvbG9yOiBibGFjayB9XG4iXX0= */\\""`; +exports[`Options Sourcemap - {String} 1`] = `"module.exports = \\"a { color: rgba(255, 0, 0, 1.0) }\\\\n\\\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvZml4dHVyZXMvY3NzL3N0eWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLDJCQUFZLEVBQUUiLCJmaWxlIjoidGVzdC9maXh0dXJlcy9jc3Mvc3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYSB7IGNvbG9yOiBibGFjayB9XG4iXX0= */\\""`; diff --git a/test/options/sourceMap.test.js b/test/options/sourceMap.test.js index 825c1ccc..873e786d 100644 --- a/test/options/sourceMap.test.js +++ b/test/options/sourceMap.test.js @@ -41,7 +41,7 @@ describe('Options', () => { return webpack('css/index.js', config).then((stats) => { const src = loader(stats).src - expect(src).toEqual("module.exports = \"a { color: rgba(255, 0, 0, 1.0) }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLDJCQUFZLEVBQUUiLCJmaWxlIjoic3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYSB7IGNvbG9yOiBibGFjayB9XG4iXX0= */\"") + expect(src).toEqual("module.exports = \"a { color: rgba(255, 0, 0, 1.0) }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvZml4dHVyZXMvY3NzL3N0eWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLDJCQUFZLEVBQUUiLCJmaWxlIjoidGVzdC9maXh0dXJlcy9jc3Mvc3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYSB7IGNvbG9yOiBibGFjayB9XG4iXX0= */\"") expect(src).toMatchSnapshot() }) })