refactor: dev

This commit is contained in:
endiliey 2018-08-01 16:33:38 +08:00
parent d9a86a54c1
commit 9070fb50ab
2 changed files with 117 additions and 119 deletions

View file

@ -41,12 +41,11 @@ module.exports = async function dev(sourceDir, cliOptions = {}) {
fsWatcher.on('addDir', reload);
fsWatcher.on('unlinkDir', reload);
// resolve webpack config
let config = createDevConfig(props);
const port = await getPort(cliOptions.port);
const {publicPath} = props;
// resolve webpack config
let config = createDevConfig(props);
config.plugin('WebpackNiceLog').use(webpackNiceLog, [
{
onDone: () => {
@ -58,7 +57,6 @@ module.exports = async function dev(sourceDir, cliOptions = {}) {
}
}
]);
config.plugin('html-webpack-plugin').use(HtmlWebpackPlugin, [
{
inject: false,