-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sourceMaps): Embed typescript sources in sourcemaps
- Loading branch information
1 parent
264d027
commit 10558a3
Showing
5 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"ARTIFACTS": [ | ||
"lib", | ||
"lib-esm", | ||
"_bundles", | ||
"package.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!env node | ||
"use strict"; | ||
|
||
require('shelljs/global'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const glob = require('glob'); | ||
const pkgName = require('../package.json').name; | ||
const prefix = path.resolve(__dirname, '..'); | ||
|
||
const allartifacts = require('./artifacts.json').ARTIFACTS; | ||
const globs = allartifacts | ||
.map(dir => path.resolve(prefix, dir)) | ||
.filter(dir => fs.lstatSync(dir).isDirectory()) | ||
.map(dir => `${dir}/**/*.js.map`); | ||
|
||
const files = globs | ||
.map(pattern => glob.sync(pattern)) | ||
.reduce((acc, arr) => acc.concat(arr), []); | ||
|
||
files.forEach(file => { | ||
const data = JSON.parse(fs.readFileSync(file)); | ||
if (Array.isArray(data.sources)) { | ||
data.sources = data.sources.map(source => source.replace(/^(?:\.\.\/)*src/, pkgName)); | ||
fs.writeFileSync(file, JSON.stringify(data)); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this change seems to have caused problems with angular-cli bundling. It seems to bundle two copies of core.