mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 09:07:29 +02:00
refactor: code
This commit is contained in:
parent
a9c3d50a68
commit
44122cd202
4 changed files with 37 additions and 48 deletions
|
@ -1,4 +1,6 @@
|
|||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const webpackNiceLog = require('webpack-nicelog');
|
||||
const createBaseConfig = require('./base');
|
||||
|
||||
module.exports = function createDevConfig(props) {
|
||||
|
@ -6,5 +8,21 @@ module.exports = function createDevConfig(props) {
|
|||
|
||||
config.entry('main').add(path.resolve(__dirname, '../core/devEntry.js'));
|
||||
|
||||
const {siteConfig} = props;
|
||||
config.plugin('html-webpack-plugin').use(HtmlWebpackPlugin, [
|
||||
{
|
||||
inject: false,
|
||||
hash: true,
|
||||
template: path.resolve(__dirname, '../core/devTemplate.ejs'),
|
||||
filename: 'index.html',
|
||||
title: siteConfig.title
|
||||
}
|
||||
]);
|
||||
config.plugin('WebpackNiceLog').use(webpackNiceLog, [
|
||||
{
|
||||
name: 'Development'
|
||||
}
|
||||
]);
|
||||
|
||||
return config;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue