diff --git a/.webpack/webpack.common.js b/.webpack/webpack.common.js index 3250ee38..2d445253 100644 --- a/.webpack/webpack.common.js +++ b/.webpack/webpack.common.js @@ -21,7 +21,9 @@ *****************************************************************************/ import path from 'node:path'; -const projectRootDir = path.resolve(__dirname, '..'); +import { fileURLToPath } from 'node:url'; + +const projectRootDir = fileURLToPath(new URL('../', import.meta.url)); // eslint-disable no-undef const WEBPACK_COMMON_CONFIG = { diff --git a/.webpack/webpack.dev.js b/.webpack/webpack.dev.js index d3613bfe..a328429c 100644 --- a/.webpack/webpack.dev.js +++ b/.webpack/webpack.dev.js @@ -23,8 +23,9 @@ import path from 'path'; import { merge } from 'webpack-merge'; import common from './webpack.common.js'; -const projectRootDir = path.resolve(__dirname, '..'); +import { fileURLToPath } from 'node:url'; +const projectRootDir = fileURLToPath(new URL('../', import.meta.url)); // eslint-disable-next-line no-undef export default merge(common, { context: projectRootDir, diff --git a/.webpack/webpack.prod.js b/.webpack/webpack.prod.js index afe4e817..36aeec88 100644 --- a/.webpack/webpack.prod.js +++ b/.webpack/webpack.prod.js @@ -23,8 +23,10 @@ import path from 'path'; import { merge } from 'webpack-merge'; import common from './webpack.common.js'; +import { fileURLToPath } from 'node:url'; + +const projectRootDir = fileURLToPath(new URL('../', import.meta.url)); -const projectRootDir = path.resolve(__dirname, '..'); // eslint-disable-next-line no-undef export default merge(common, { context: projectRootDir,