Skip to content

Commit

Permalink
fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Feb 3, 2024
1 parent 2dbaeba commit 7d07a28
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const rules = require('./rules')
const plugins = require('./plugins')
const devServer = require('./devServer')

const rootDir = process.cwd()

const defaultEnv = {
dev: false,
out: 'dist',
Expand All @@ -27,12 +25,13 @@ module.exports = env => {

const isDev = envOptions.dev
const outDir = envOptions.out
const distDir = path.join(rootDir, outDir)
const rootDir = path.resolve(__dirname, '..')
const distDir = path.resolve(rootDir, defaultEnv.out)

return {
mode: isDev ? 'development' : 'production',
target: 'web',
context: path.resolve(__dirname, '..'),
context: rootDir,
entry: {
app: './src/index.tsx',
},
Expand All @@ -48,7 +47,7 @@ module.exports = env => {
alias: isDev
? undefined
: {
lodash: path.join(rootDir, 'node_modules/lodash-es'),
lodash: require.resolve('lodash-es'),
// 'react': path.join(rootDir, 'node_modules/react/dist/react.min.js'),
// 'react-dom': path.join(rootDir, 'node_modules/react-dom/dist/react-dom.min.js'),
},
Expand Down

0 comments on commit 7d07a28

Please sign in to comment.