webpack-serve-output
can outputs content compiled by webpack-dev-server
to the file system, and the files can be hot updated.
npm install webpack-serve-output
Add webpack-serve-output
to plugins in the webpack.config.js
file, it will output content compiled by webpack-dev-server
to the file system when the serve is running.
The output directory is output.path
in the config of webpack by default.
// webpack.config.js
const WebpackServeOutput = require('webpack-serve-output');
module.exports = {
// ...other config
plugins: [new WebpackServeOutput()],
};
Specifies the output directory:
// webpack.config.js
const path = require('path');
const WebpackServeOutput = require('webpack-serve-output');
module.exports = {
// ...other config
plugins: [new WebpackServeOutput({
outputPath: path.resolve(__dirname, './output')
})],
};
Licensed under MIT
Copyright (c) 2022 zhoulixiang