Skip to content

Commit

Permalink
Config: Simpler webpack config working with new pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisat committed Nov 24, 2024
1 parent ea205c0 commit cd84345
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions webpack.dist.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const nodeExternals = require('webpack-node-externals');
const isSingleModule =
fs.existsSync('./src/index.ts') ||
fs.existsSync('./src/index.tsx');
const thisPackageBelongsToMonorepo =
fs.existsSync('../../package.json') &&
!!require('../../package.json').workspaces;

const package_ = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const loaders = require('./webpack.loaders.js');
Expand Down Expand Up @@ -52,15 +49,7 @@ module.exports = {
return acc;
}, {})
),
externals:
thisPackageBelongsToMonorepo
? [ // exclude all dependencies from the bundle
nodeExternals(),
nodeExternals({
modulesDir: path.resolve(__dirname, '../../node_modules')
})
]
: nodeExternals(),
externals: nodeExternals(),
optimization: {
// help: https://webpack.js.org/guides/tree-shaking/
usedExports: true, // true to remove the dead code,
Expand Down

0 comments on commit cd84345

Please sign in to comment.