Skip to content

Commit

Permalink
fix(index): don't set to value (options) (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored and michael-ciniawsky committed Feb 26, 2018
1 parent 0a643de commit cdbb8b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions test/options/__snapshots__/sourceMap.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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= */\\""`;
2 changes: 1 addition & 1 deletion test/options/sourceMap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
Expand Down

0 comments on commit cdbb8b6

Please sign in to comment.