@@ -6,23 +6,20 @@ const debugError = require('debug')('pixore:error')
66const chalk = require ( 'chalk' )
77const webpack = require ( 'webpack' )
88const assign = require ( 'lodash.assign' )
9- const appRoot = fs . realpathSync ( process . cwd ( ) )
109const formatWebpackMessages = require ( 'react-dev-utils/formatWebpackMessages' )
1110
1211debug . namespace = ''
1312
1413debugError . color = require ( 'debug' ) . colors [ 5 ]
1514
16- const { APP_PATH , ROOT_PATH , MAIN_TEMPLATE } = require ( './config/environment' )
15+ const { APP_PATH , ROOT_PATH , MAIN_TEMPLATE , ESLINT_PATH } = require ( './config/environment' )
1716const config = require ( './config/webpack.config.js' )
1817
1918let customConfig = { }
20- if ( fs . existsSync ( path . join ( appRoot , 'webpack.config.js' ) ) ) {
21- customConfig = require ( path . join ( appRoot , 'webpack.config.js' ) )
19+ if ( fs . existsSync ( path . join ( ROOT_PATH , 'webpack.config.js' ) ) ) {
20+ customConfig = require ( path . join ( ROOT_PATH , 'webpack.config.js' ) )
2221}
2322
24- const eslintFilePath = path . join ( appRoot , '.eslintrc.js' )
25-
2623exports . setupCompile = ( ) => {
2724 const compiler = webpack ( assign ( config , customConfig ) )
2825
@@ -64,8 +61,8 @@ exports.validStructure = () => {
6461 debugError ( APP_PATH . replace ( ROOT_PATH , '' ) + ' doesn\'t exists' )
6562 process . exit ( 1 )
6663 }
67- if ( ! fs . existsSync ( eslintFilePath ) ) {
68- debugError ( eslintFilePath . replace ( ROOT_PATH , '' ) + ' doesn\'t exists' )
64+ if ( ! fs . existsSync ( ESLINT_PATH ) ) {
65+ debugError ( ESLINT_PATH . replace ( ROOT_PATH , '' ) + ' doesn\'t exists' )
6966 process . exit ( 1 )
7067 }
7168 if ( ! fs . existsSync ( MAIN_TEMPLATE ) ) {
0 commit comments