bitcrowd / tickety-tick

A browser extension that helps you name branches and write better commit messages
MIT License
57 stars 10 forks source link

Upgrade to Webpack 5 #272

Closed pmeinhardt closed 3 years ago

pmeinhardt commented 3 years ago

Upgrade to webpack 5: https://webpack.js.org/migrate/5/

Upgrade webpack CLI, loaders and plugins.

Slightly reduces bundle size for popup and options JS files.

There are 2 deprecation warnings, but everything builds as expected:

  1. From git-revision-plugin: https://github.com/pirelenito/git-revision-webpack-plugin/issues/50 (fix proposed here: https://github.com/pirelenito/git-revision-webpack-plugin/pull/56)
  2. From html-webpack-plugin: https://github.com/jantimon/html-webpack-plugin/issues/1527#issuecomment-708575672
❯ yarn run cross-env VARIANT=chrome node --trace-deprecation node_modules/webpack/bin/webpack.js --config webpack.config.babel.js
yarn run v1.22.10
$ /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/.bin/cross-env VARIANT=chrome node --trace-deprecation node_modules/webpack/bin/webpack.js --config webpack.config.babel.js
(node:13067) [DEP_WEBPACK_MAIN_TEMPLATE_ASSET_PATH] DeprecationWarning: MainTemplate.hooks.assetPath is deprecated (use Compilation.hooks.assetPath instead)
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/git-revision-webpack-plugin/lib/build-file.js:16:46
    at Hook.eval (eval at create (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:919:26)
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:960:29
    at Hook.eval [as callAsync] (eval at create (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:955:28)
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:456:12
    at Compiler.readRecords (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:797:11)
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:453:11
    at Hook.eval [as callAsync] (eval at create (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/webpack/lib/Compiler.js:450:20
    at Hook.eval [as callAsync] (eval at create (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/tapable/lib/Hook.js:18:14)
(node:13067) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
    Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
    Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
    at /Users/pmeinhardt/Code/bitcrowd/tickety-tick/node_modules/html-webpack-plugin/index.js:280:49
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
klappradla commented 3 years ago

Nice and shine nicenstein ⭐