mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-25 15:27:57 +02:00
fix(v2): map loaded modules to bundles (#1056)
* fix(v2): map loaded modules to bundles * nits
This commit is contained in:
parent
2ce6ca5854
commit
5d60739f7c
3 changed files with 37 additions and 16 deletions
v2/lib/webpack
|
@ -1,6 +1,7 @@
|
|||
const path = require('path');
|
||||
const webpackNiceLog = require('webpack-nicelog');
|
||||
const {StatsWriterPlugin} = require('webpack-stats-plugin');
|
||||
const {ReactLoadablePlugin} = require('react-loadable/webpack');
|
||||
const cleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const createBaseConfig = require('./base');
|
||||
const {applyChainWebpack} = require('./utils');
|
||||
|
@ -17,8 +18,13 @@ module.exports = function createClientConfig(props) {
|
|||
|
||||
// write webpack stats object so we can pickup correct client bundle path in server.
|
||||
config
|
||||
.plugin('stats')
|
||||
.plugin('client-stats')
|
||||
.use(StatsWriterPlugin, [{filename: 'client.stats.json'}]);
|
||||
config
|
||||
.plugin('react-loadable-stats')
|
||||
.use(ReactLoadablePlugin, [
|
||||
{filename: path.join(outDir, 'react-loadable.json')},
|
||||
]);
|
||||
|
||||
// show compilation progress bar and build time
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue