Skip to content

Commit

Permalink
chore(internal): reverting to prevent increased bundle size
Browse files Browse the repository at this point in the history
Webpacks's treeshaking is negatively impacted by telling it to prefer
`main` field instead of `module`. `module` point to esm modules which
are what webpack needs to do its [treeshaking](https://webpack.js.org/guides/tree-shaking/).
  • Loading branch information
namjul committed Nov 11, 2022
1 parent 197c5c6 commit d4609a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/dendron-plugin-views/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ module.exports = function (webpackEnv) {
],
},
resolve: {
// Prefer `main` over `module`
mainFields: ["main", "module"],
// This allows you to set a fallback for where webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
Expand Down Expand Up @@ -431,6 +429,7 @@ module.exports = function (webpackEnv) {
test: /\.(js|mjs)$/,
exclude: /@babel(?:\/|\\{1,2})runtime/,
loader: require.resolve("babel-loader"),
type: "javascript/auto",
options: {
babelrc: false,
configFile: false,
Expand Down

0 comments on commit d4609a7

Please sign in to comment.