New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta: Update dependencies and simplify build #3639
Conversation
This simplifies the build further
// Automatically enabled on production; | ||
// Keeps it somewhat readable for AMO reviewers | ||
minimizer: [ | ||
new TerserPlugin({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped all of this because AMO doesn't seem to mind minified code. Also the .map
files are still included.
from: 'source', | ||
globOptions: { | ||
ignore: [ | ||
'**/*.js', | ||
'**/*.ts', | ||
'**/*.tsx', | ||
'**/*.css' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped this configuration in lieu of just keeping 3 (THREE!) static files in the distribution
folder.
I was hoping to drop CopyWebpackPlugin
completely but apparently import 'webextension-polyfill'
doesn't work with Webpack, it won't be a global. With Parcel it works.
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'ts-loader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsc
alternatives include swc
and sucrase
. esbuild
is the fastest one according to https://twitter.com/youyuxi/status/1257661327180361730
I checked the output and it's the same, except the transpilation of ?.
and ...
esbuild
also includes a fast minifier, but the output is not as minified as Terser’s, so it's not worth replacing it.
🎉 |
Indeed. This also saves a lot of bytes 😛
|
The build size should be much smaller now |
https://github.com/fregante/delegate-it/releases/tag/v2.0.1 or is this not part of this pr? |
It's unrelated to the build, it can be done separately. Not urgent either 😄 |
Resolve conflicts stopped working |
Heh, I thought about testing it and then forgot while I was looking for conflicts. Fixed in the latest commit |
I am unable to build 😢 not sure whats wrong! |
GitHub Actions passed. Npm install and use node 14 |
That worked thanks |
ts-loader
withesbuild-loader
to save a couple of seconds of build time./distribution
instead of using Webpack to copy them (reduces config)DefinePlugin
Overall, the config file is 46 lines shorter (-27%) 🍰
Next, maybe:
👆 made with https://webpack.js.org/plugins/profiling-plugin/