修复初始化报错

This commit is contained in:
dengtongyu committed 2019-01-12 21:15:23 +08:00
1 parent 18388346d5
commit 7e7e2cb2f5
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -2,8 +2,8 @@
const path = require('path'); const path = require('path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const chalk = require('chalk'); const chalk = require('chalk');
const webpack = require('webpack'); //const webpack = require('webpack');
const webpackDevServer = require('webpack-dev-server'); //const webpackDevServer = require('webpack-dev-server');
const util = require('./util'); const util = require('./util');
const webpackConfig = require('./webpack.react'); const webpackConfig = require('./webpack.react');
@@ -27,7 +27,7 @@ exports.init = (type, paths, command) => {
_configJson = util.configJson(_paths.targetPath); _configJson = util.configJson(_paths.targetPath);
if(_configJson.template == 'react') { if(_configJson.template == 'react') {
webpackConfig.run(command); webpackConfig.run(paths, command);
} }
}) })
.catch(err => { .catch(err => {
+1 -1
View File
@@ -38,7 +38,7 @@ let _webpackConfig = {
}; };
exports.run = (paths, command) => { exports.run = (paths, command) => {
console.log(paths);
//入口文件 //入口文件
_webpackConfig.entry = path.join(paths.targetPath, 'src', 'index.js'); _webpackConfig.entry = path.join(paths.targetPath, 'src', 'index.js');