@@ -13,10 +13,9 @@ import * as WebpackDevServer from 'webpack-dev-server';
13
13
import * as SpeedMeasurePlugin from 'speed-measure-webpack-plugin' ;
14
14
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' ;
15
15
import { globalState } from './global-state' ;
16
- import { tempPath } from './structor-config' ;
16
+ import { tempPath , srcPath , packagesPath } from './structor-config' ;
17
17
import { logInfo } from './log' ;
18
18
import { getWebpackConfig , IOptions } from './webpack-config' ;
19
- import { pri } from '../node' ;
20
19
21
20
const smp = new SpeedMeasurePlugin ( ) ;
22
21
@@ -71,12 +70,20 @@ export const runWebpackDevServer = async (opts: IOptions<IExtraOptions>) => {
71
70
memoryLimit : 8192 ,
72
71
mode : 'write-references' ,
73
72
} ,
73
+ eslint : {
74
+ memoryLimit : 8192 ,
75
+ enabled : globalState . sourceConfig . eslintChecker ?. enabled ?? false ,
76
+ files : globalState . sourceConfig . eslintChecker ?. files ?? [
77
+ `./${ srcPath . dir } /**/*.{ts,tsx}` ,
78
+ `./${ packagesPath . dir } /**/*.{ts,tsx}` ,
79
+ ] ,
80
+ } ,
74
81
} ) ,
75
82
) ;
76
83
}
77
84
78
85
const webpackDevServerConfig : WebpackDevServer . Configuration = {
79
- host : pri . sourceConfig . host ,
86
+ host : globalState . sourceConfig . host ,
80
87
hot : opts . hot ,
81
88
hotOnly : opts . hot ,
82
89
publicPath : opts . publicPath ,
@@ -124,16 +131,16 @@ export const runWebpackDevServer = async (opts: IOptions<IExtraOptions>) => {
124
131
125
132
const devServer = new WebpackDevServer ( compiler as any , webpackDevServerConfig ) ;
126
133
127
- devServer . listen ( opts . devServerPort , pri . sourceConfig . host , ( ) => {
134
+ devServer . listen ( opts . devServerPort , globalState . sourceConfig . host , ( ) => {
128
135
let devUrl : string = null ;
129
136
const localSuggestUrl = urlJoin (
130
- `${ opts . https || globalState . sourceConfig . useHttps ? 'https' : 'http' } ://${ pri . sourceConfig . host } :${
137
+ `${ opts . https || globalState . sourceConfig . useHttps ? 'https' : 'http' } ://${ globalState . sourceConfig . host } :${
131
138
opts . devServerPort
132
139
} `,
133
140
globalState . sourceConfig . baseHref ,
134
141
) ;
135
142
136
- if ( opts . devUrl === pri . sourceConfig . host ) {
143
+ if ( opts . devUrl === globalState . sourceConfig . host ) {
137
144
devUrl = localSuggestUrl ;
138
145
} else if ( opts . devUrl !== undefined ) {
139
146
( { devUrl } = opts ) ;
0 commit comments