mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 09:07:29 +02:00
feat: remove/clean your build folder(s) before building
This commit is contained in:
parent
406106b67e
commit
e13e1bffb4
3 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
const path = require('path');
|
||||
const webpackNiceLog = require('webpack-nicelog');
|
||||
const {StatsWriterPlugin} = require('webpack-stats-plugin');
|
||||
const cleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const createBaseConfig = require('./base');
|
||||
|
||||
module.exports = function createClientConfig(props) {
|
||||
|
@ -8,6 +9,11 @@ module.exports = function createClientConfig(props) {
|
|||
|
||||
config.entry('main').add(path.resolve(__dirname, '../core/clientEntry.js'));
|
||||
|
||||
const {outDir} = props;
|
||||
config
|
||||
.plugin('clean')
|
||||
.use(cleanWebpackPlugin, [outDir, {verbose: false, allowExternal: true}]);
|
||||
|
||||
// write webpack stats object to a file so we can
|
||||
// programmatically refer to the correct bundle path in Node.js server.
|
||||
config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue