I'd like to achieve something like this:
npm run build --path custom
in order to set a different output.path that will be used in webpack.config.js
Does something like this exists?
The solution used in the end uses this command:
DIST=[YOUR-DIRECTORY] npm run build
The webpack.config
handles the value of DIST
like:
const target = process.env.DIST
? process.env.DIST
: 'dist';
and in the output we go with:
path: path.resolve(__dirname, target)