Skip to content

Commit

Permalink
Merge pull request #204 from gxbsst/main
Browse files Browse the repository at this point in the history
chore: 修正错误的单词拼写
  • Loading branch information
shujian-cao authored Aug 15, 2024
2 parents 644f8fa + 6df3540 commit b8c0a26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-compiler/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function compileWorkers(
const globalObject = userConfig.globalObject
const srcPaths = userConfig.srcPaths

let workerEnabed = false
let workerEnabled = false

/**
* 需要编译的 worker 文件(不带后缀)
Expand All @@ -182,7 +182,7 @@ function compileWorkers(

const PLUGIN_NAME_WORKER = PLUGIN_NAME + '_WORKER'
runner.hooks.beforeBuildEntries.tap(PLUGIN_NAME_WORKER, (entryBuilder) => {
workerEnabed = !!entryBuilder.appJson?.workers
workerEnabled = !!entryBuilder.appJson?.workers
})

compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME_WORKER, (factory) => {
Expand All @@ -197,7 +197,7 @@ function compileWorkers(
.tap(PLUGIN_NAME_WORKER, (parser) => parse(parser))

function parse(parser: webpack.javascript.JavascriptParser) {
if (!workerEnabed) return
if (!workerEnabled) return

type Expression = Parameters<
ReturnType<
Expand Down Expand Up @@ -240,7 +240,7 @@ function compileWorkers(
compilation.hooks.additionalAssets.tapPromise(
PLUGIN_NAME_WORKER,
async () => {
if (!workerEnabed || !workerFiles.size) return
if (!workerEnabled || !workerFiles.size) return

for await (const file of workerFiles) {
const entryName = file + '.js'
Expand Down

0 comments on commit b8c0a26

Please sign in to comment.