Skip to content

Commit

Permalink
also filter out hmr json files
Browse files Browse the repository at this point in the history
  • Loading branch information
ztoben committed Oct 14, 2020
1 parent e5d3f4c commit 92d5c41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ AssetsWebpackPlugin.prototype = {
let added = false
const typeMap = assets.reduce(function (typeMap, obj) {
const asset = obj.name || obj

console.log(asset)

if (isHMRUpdate(options, asset) || isSourceMap(options, asset) || (!chunkName && seenAssets[asset])) {
return typeMap
}
Expand Down
2 changes: 2 additions & 0 deletions lib/isHMRUpdate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const pathTemplate = require('./pathTemplate')

module.exports = function isHMRUpdate (options, asset) {
if (asset.includes('.hot-update.')) return true

const hotUpdateChunkFilename = options.output.hotUpdateChunkFilename
const hotUpdateTemplate = pathTemplate(hotUpdateChunkFilename)
return hotUpdateTemplate.matches(asset)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assets-webpack-plugin",
"version": "6.0.0-alpha.4",
"version": "6.0.0-alpha.5",
"description": "Emits a json file with assets paths",
"main": "dist/index.js",
"engines": {
Expand Down

0 comments on commit 92d5c41

Please sign in to comment.