Answer the question
In order to leave comments, you need to log in
How to change __dirname in webpack?
By default, __dirname refers to the same directory as the webpack config. If base.config.js is moved to the root, then the dist folder will be compiled there as well. But I need to leave the build logic in the config folder, can you tell me how to do this?
Answer the question
In order to leave comments, you need to log in
const path = require('path');
const ROOT_DIR = path.resolve(__dirname, '..');
module.exports = {
output: {
path: path.resolve(ROOT_DIR, 'dist')
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question