Commit c73f7d6a authored by Tomáš Witek's avatar Tomáš Witek Committed by Arunoda Susiripala

Unlink only pages bundle in dev env (#4015)

* Unlink only pages bundle in dev env

* Use IS_BUNDLED_PAGE regexp for unlink file plugin
parent f0308687
import { join } from 'path' import { join } from 'path'
import { unlink } from 'mz/fs' import { unlink } from 'mz/fs'
import { IS_BUNDLED_PAGE } from '../../utils'
export default class UnlinkFilePlugin { export default class UnlinkFilePlugin {
constructor () { constructor () {
...@@ -9,7 +10,7 @@ export default class UnlinkFilePlugin { ...@@ -9,7 +10,7 @@ export default class UnlinkFilePlugin {
apply (compiler) { apply (compiler) {
compiler.plugin('after-emit', (compilation, callback) => { compiler.plugin('after-emit', (compilation, callback) => {
const removed = Object.keys(this.prevAssets) const removed = Object.keys(this.prevAssets)
.filter((a) => !compilation.assets[a]) .filter((a) => IS_BUNDLED_PAGE.test(a) && !compilation.assets[a])
this.prevAssets = compilation.assets this.prevAssets = compilation.assets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment