updating packages for webpack 5 compatibility

This commit is contained in:
raviteja9135@gmail.com 2021-06-09 14:29:37 +05:30
parent f754feae72
commit 174b9d314e
5 changed files with 8 additions and 5 deletions

View file

@ -241,6 +241,9 @@ to prevent stripping out AIV comments eg:
``` ```
# Change log # Change log
## [1.2.3] - 09/06/2021
- updates for webpack 5 comatibility
## [1.2.2] - 27/10/2018 ## [1.2.2] - 27/10/2018
- add PACKAGE_JSON_INDENT @trevyn - add PACKAGE_JSON_INDENT @trevyn
## [1.2.1] - 27/10/2018 ## [1.2.1] - 27/10/2018

View file

@ -1,6 +1,6 @@
{ {
"name": "webpack-auto-inject-version", "name": "webpack-auto-inject-version",
"version": "1.2.2", "version": "1.2.3",
"repository": "radswiat/webpack-auto-inject-version", "repository": "radswiat/webpack-auto-inject-version",
"description": "Webpack plugin for auto inject version from package.json", "description": "Webpack plugin for auto inject version from package.json",
"main": "dist/WebpackAutoInjectVersion.js", "main": "dist/WebpackAutoInjectVersion.js",
@ -37,7 +37,7 @@
"lodash": "^4.17.11", "lodash": "^4.17.11",
"optimist": "^0.6.1", "optimist": "^0.6.1",
"semver": "^5.3.0", "semver": "^5.3.0",
"webpack": "^2.3.3", "webpack": "^5.38.1",
"webpack-node-externals": "^1.5.4" "webpack-node-externals": "^1.5.4"
} }
} }

View file

@ -32,7 +32,7 @@ export default class AutoIncreaseVersion {
// we have to register AutoIncreaseVersion instead of firing it straight away // we have to register AutoIncreaseVersion instead of firing it straight away
if (config.componentsOptions.AutoIncreaseVersion.runInWatchMode) { if (config.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
if (this.context.compiler) { if (this.context.compiler) {
this.context.compiler.plugin('emit', (compilation, cb) => { this.context.compiler.hooks.emit.tapAsync('emit', (compilation, cb) => {
this.start(); this.start();
cb(); cb();
}); });

View file

@ -30,7 +30,7 @@ export default class InjectAsComment {
*/ */
apply() { apply() {
// bind into emit hook // bind into emit hook
this.context.compiler.plugin('emit', (compilation, cb) => { this.context.compiler.hooks.emit.tapAsync('emit', (compilation, cb) => {
// iterate over all assets file in compilation // iterate over all assets file in compilation
for (const basename in compilation.assets) { for (const basename in compilation.assets) {
// bug fix, extname is not able to handle chunk file params index.js?random123 // bug fix, extname is not able to handle chunk file params index.js?random123

View file

@ -21,7 +21,7 @@ export default class InjectByTag {
* @return {Promise} * @return {Promise}
*/ */
apply() { apply() {
this.context.compiler.plugin('emit', (compilation, cb) => { this.context.compiler.hooks.emit.tapAsync('emit', (compilation, cb) => {
// for every output file // for every output file
for (const basename in compilation.assets) { for (const basename in compilation.assets) {
// only if match regex // only if match regex