refactor: code

This commit is contained in:
endiliey 2018-08-08 14:25:02 +08:00
parent a9c3d50a68
commit 44122cd202
4 changed files with 37 additions and 48 deletions

View file

@ -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;
};