Skip to content

Commit

Permalink
fix(server): ignore source maps
Browse files Browse the repository at this point in the history
Source maps must no be included in links.

See #128
  • Loading branch information
gregberge committed Nov 13, 2018
1 parent 1ea8465 commit 9991bbd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
3 changes: 2 additions & 1 deletion packages/server/__fixtures__/stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
},
"childAssets": {
"preload": [
"letters-C.js"
"letters-C.js",
"letters-C.js.map"
],
"prefetch": [
"letters-D.js"
Expand Down
36 changes: 20 additions & 16 deletions packages/server/src/ChunkExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ class ChunkExtractor {
getChunkAssets(chunks) {
const one = chunk => {
const chunkGroup = this.getChunkGroup(chunk)
return chunkGroup.assets.map(filename =>
this.createChunkAsset({
filename,
chunk,
type: 'mainAsset',
linkType: 'preload',
}),
)
return chunkGroup.assets
.map(filename =>
this.createChunkAsset({
filename,
chunk,
type: 'mainAsset',
linkType: 'preload',
}),
)
.filter(chunkAsset => chunkAsset.scriptType)
}

if (Array.isArray(chunks)) {
Expand All @@ -132,14 +134,16 @@ class ChunkExtractor {
const one = chunk => {
const chunkGroup = this.getChunkGroup(chunk)
const assets = chunkGroup.childAssets[type] || []
return assets.map(filename =>
this.createChunkAsset({
filename,
chunk,
type: 'childAsset',
linkType: type,
}),
)
return assets
.map(filename =>
this.createChunkAsset({
filename,
chunk,
type: 'childAsset',
linkType: type,
}),
)
.filter(chunkAsset => chunkAsset.scriptType)
}

if (Array.isArray(chunks)) {
Expand Down

0 comments on commit 9991bbd

Please sign in to comment.