Skip to content

Commit

Permalink
Fix bin/checkLanguageKeys for system.js projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Dec 16, 2015
1 parent e3659ab commit ebdc2a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions bin/applyBabelJob
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,7 @@ new AssetGraph({root: commandLineOptions.root})
});
}
asset._rawSrc = replacedText.toString('utf-8');
// Hack: Prevent system.js bundles from being written to disc:
if (assetGraph.findRelations({ from: asset, to: { type: 'SourceMap' } }).length === 0) {
asset.hasReplacedLanguageKeys = true;
}
asset.hasReplacedLanguageKeys = true;
});
}
})
Expand Down
1 change: 1 addition & 0 deletions bin/checkLanguageKeys
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ new AssetGraph({root: rootUrl})
.loadAssets(inputUrls)
.populate({from: {type: 'Html'}, followRelations: {type: 'HtmlScript', to: {url: /^file:/}}})
.assumeRequireJsConfigHasBeenFound()
.bundleSystemJs({ sourceMaps: true })
.populate({
followRelations: query.or(
{
Expand Down
2 changes: 2 additions & 0 deletions bin/makeBabelJob
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ new AssetGraph({root: commandLineOptions.root})
.populate({from: {type: 'Html'}, followRelations: {type: 'HtmlScript', to: {url: /^file:/}}})
.assumeRequireJsConfigHasBeenFound()
.bundleSystemJs()
.serializeSourceMaps()
.populate({ startAssets: { type: 'SourceMap' }, followRelations: { to: { url: /^file:\// } } })
.fixBaseAssetsOfUnresolvedOutgoingRelationsFromHtmlFragments({isInitial: true})
.assumeThatAllHtmlFragmentAssetsWithoutIncomingRelationsAreNotTemplates()
.populate({
Expand Down
3 changes: 2 additions & 1 deletion lib/i18nTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ i18nTools.findOccurrences = function (assetGraph, initialAssets) {
var trOccurrencesByKey = {};
initialAssets.forEach(function (htmlAsset) {
assetGraph.collectAssetsPostOrder(htmlAsset, {type: assetGraph.query.not(['HtmlAnchor', 'HtmlMetaRefresh', 'SvgAnchor'])}).forEach(function (asset) {
if (asset.isLoaded) {
// Hack: Prevent system.js bundles from being written to disc:
if (asset.isLoaded && assetGraph.findRelations({ from: asset, to: { type: 'SourceMap' } }).length === 0) {
if (asset.type === 'JavaScript') {
if (asset.incomingRelations.length === 0 || !asset.incomingRelations.every(isBootstrapperRelation)) {
i18nTools.eachTrInAst(asset.parseTree, function (occurrence) {
Expand Down

0 comments on commit ebdc2a3

Please sign in to comment.