Skip to content

Commit

Permalink
fix: clean dead logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jun 30, 2021
1 parent e2ebb84 commit f88fd86
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/vite-plugin-checker/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ export function createScript<T>({
buildBin,
serverChecker,
}: WorkerScriptOptions): Script<T> {
// let _env: ConfigEnv | undefined
type CheckerConfig = T & SharedConfig
let _env: ConfigEnv
return {
mainScript: () => {
// initialized in main thread
const createWorker = (
checkerConfig: CheckerConfig,
env: ConfigEnv
): ConfigureServeChecker => {
_env = env
const isBuild = env.command === 'build'

const worker = new Worker(absFilename, {
Expand Down Expand Up @@ -85,7 +82,6 @@ export function createScript<T>({
switch (action.type) {
case ACTION_TYPES.config: {
const checkerConfig: T = workerData.checkerConfig
invariant(_env, 'env should be initialized in mainScript, but got undefined')
diagnostic = serverChecker.createDiagnostic(checkerConfig)
diagnostic.config(action.payload)
break
Expand Down

0 comments on commit f88fd86

Please sign in to comment.