-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change cache type.
- Loading branch information
Showing
7 changed files
with
188 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module.exports = function (source) { | ||
if (this.cacheable) { | ||
this.cacheable(true); | ||
} | ||
return source.replace(/ from 'node:([a-zA-Z]+)'/ig, " from '$1'"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { WebpackPluginInstance, Compiler } from 'webpack'; | ||
|
||
export default class WatchMarkersPlugin implements WebpackPluginInstance { | ||
private buildCounter = 0; | ||
|
||
public apply(compiler: Compiler) { | ||
compiler.hooks.infrastructureLog.tap('WatchMarkersPlugin', (arg0, arg1, arg2) => { | ||
const messages = arg2.filter(m => typeof m === 'string'); | ||
const isCompileStart = messages.some(msg => /Compiler '[\w\d]+' starting... /i.test(msg)); | ||
const isCompileEnd = messages.some(msg => msg.endsWith('watching files for updates...')); | ||
|
||
if (isCompileStart && this.buildCounter++ == 0 ) { | ||
console.debug('Build starting...'); | ||
} else if (isCompileEnd && --this.buildCounter == 0 ) { | ||
console.debug('Build completed!'); | ||
} | ||
|
||
return true; | ||
}); | ||
} | ||
} |
Oops, something went wrong.