Skip to content

Commit 9991bbd

Browse files
committed
fix(server): ignore source maps
Source maps must no be included in links. See #128
1 parent 1ea8465 commit 9991bbd

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

packages/server/__fixtures__/stats.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
},
170170
"childAssets": {
171171
"preload": [
172-
"letters-C.js"
172+
"letters-C.js",
173+
"letters-C.js.map"
173174
],
174175
"prefetch": [
175176
"letters-D.js"

packages/server/src/ChunkExtractor.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,16 @@ class ChunkExtractor {
111111
getChunkAssets(chunks) {
112112
const one = chunk => {
113113
const chunkGroup = this.getChunkGroup(chunk)
114-
return chunkGroup.assets.map(filename =>
115-
this.createChunkAsset({
116-
filename,
117-
chunk,
118-
type: 'mainAsset',
119-
linkType: 'preload',
120-
}),
121-
)
114+
return chunkGroup.assets
115+
.map(filename =>
116+
this.createChunkAsset({
117+
filename,
118+
chunk,
119+
type: 'mainAsset',
120+
linkType: 'preload',
121+
}),
122+
)
123+
.filter(chunkAsset => chunkAsset.scriptType)
122124
}
123125

124126
if (Array.isArray(chunks)) {
@@ -132,14 +134,16 @@ class ChunkExtractor {
132134
const one = chunk => {
133135
const chunkGroup = this.getChunkGroup(chunk)
134136
const assets = chunkGroup.childAssets[type] || []
135-
return assets.map(filename =>
136-
this.createChunkAsset({
137-
filename,
138-
chunk,
139-
type: 'childAsset',
140-
linkType: type,
141-
}),
142-
)
137+
return assets
138+
.map(filename =>
139+
this.createChunkAsset({
140+
filename,
141+
chunk,
142+
type: 'childAsset',
143+
linkType: type,
144+
}),
145+
)
146+
.filter(chunkAsset => chunkAsset.scriptType)
143147
}
144148

145149
if (Array.isArray(chunks)) {

0 commit comments

Comments
 (0)