Skip to content

Commit

Permalink
Revert source-map package flattening: webpack/webpack-sources#34
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanelian committed Feb 20, 2018
1 parent 7929585 commit ef72ba5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/yargs": "^11.0.0"
},
"resolutions": {
"**/@types/node": "8",
"**/source-map": "0.7.1"
"**/@types/node": "8"
}
}
5 changes: 3 additions & 2 deletions src/SassBuildTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ export class SassBuildTool {

let t1 = logAndWriteUtf8FileAsync(cssOutput, cssResult.css);
if (cssResult.map) {
let sm: RawSourceMap = cssResult.map.toJSON();
this.fixSourceMap(sm);
let sm = cssResult.map.toJSON();
// HACK: SourceMap version 0.7.1 changes RawSourceMap typing...
this.fixSourceMap(sm as any);
await logAndWriteUtf8FileAsync(cssOutput + '.map', JSON.stringify(sm));
}
await t1;
Expand Down
4 changes: 2 additions & 2 deletions src/loaders/core-typescript-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = function (this: loader.LoaderContext, source: string) {
// console.log(this.resourcePath);
let sm: RawSourceMap = JSON.parse(result.sourceMapText);
sm.sources = [this.resourcePath];

this.callback(null, result.outputText, sm);
// HACK: https://github.com/webpack/webpack-sources/issues/34
this.callback(null, result.outputText, sm as any);
} else {
this.callback(null, result.outputText);
}
Expand Down
3 changes: 2 additions & 1 deletion src/loaders/template-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ module.exports = function (this: loader.LoaderContext, html: string) {

gen.setSourceContent(this.resourcePath, html);
let sm = gen.toJSON();
this.callback(null, template, sm);
// HACK: https://github.com/webpack/webpack-sources/issues/34
this.callback(null, template, sm as any);
} else {
this.callback(null, template);
}
Expand Down
20 changes: 19 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ align-text@^0.1.1, align-text@^0.1.3:
longest "^1.0.1"
repeat-string "^1.5.2"

amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"

ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
Expand Down Expand Up @@ -2607,10 +2611,24 @@ source-list-map@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"

source-map@0.5.x, source-map@0.7.1, source-map@^0.4.2, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.5.1, source-map@~0.6.1:
source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"

source-map@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.1.tgz#493620ba1692945d680b93862435bf0ed95a2aa4"

source-map@^0.4.2:
version "0.4.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
dependencies:
amdefine ">=0.0.4"

source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

spdx-correct@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40"
Expand Down

0 comments on commit ef72ba5

Please sign in to comment.