Better configuration suggestions for @snowpack/plugin-webpack #700
ahuglajbclajep
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
Thank you so much! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here are a few small suggestions for
@snowpack/plugin-webpack
configuration.Include
@babel/preset-env
in package.jsonThe
webpackConfig
in plugin.js uses@babel/preset-env
, which is not included in package.json and needs to be installed additionally, which can be misleading.Also,
terser-webpack-plugin
is included in thewebpack
and does not need to be installed with package.json.Specifying the version of
core-js
in more detailIn the core-js's README, it's recommended to specify the version in more detail when using
core-js
in babel.Therefore, I recommend setting it up as follows:
Add
@babel/plugin-transform-runtime
By using @babel/plugin-transform-runtim to avoid duplicate helper functions inserted by babel, you can further reduce the size of your code.
To set this up, add
@babel/plugin-transform-runtime
to your devdependencies, add@babel/runtime
to your dependencies and add the following setting:Note: This is only for helper function reuse and polyfill is done in
@babel/preset-env
, socorejs:
setting here is unnecessary.Beta Was this translation helpful? Give feedback.
All reactions