docusaurus/packages/docusaurus/lib/webpack/client.js
Endilie Yacop Sucipto 15bc33df50
chore(v2): rename/ restructure folder (#1351)
* chore(v2): restructure folder

* typo

* fix test
2019-04-10 14:20:15 +07:00

37 lines
1,016 B
JavaScript

/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const path = require('path');
const WebpackNiceLog = require('webpack-nicelog');
const ReactLoadableSSRAddon = require('react-loadable-ssr-addon');
const merge = require('webpack-merge');
const createBaseConfig = require('./base');
module.exports = function createClientConfig(props) {
const isProd = process.env.NODE_ENV === 'production';
const config = createBaseConfig(props);
const clientConfig = merge(config, {
entry: {
main: path.resolve(__dirname, '../client/clientEntry.js'),
},
plugins: [
// Generate manifests file
new ReactLoadableSSRAddon({
filename: 'assets-manifest.json',
}),
// Show compilation progress bar and build time.
new WebpackNiceLog({
name: 'Client',
skipBuildTime: isProd,
}),
],
});
return clientConfig;
};