Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 修正错误的单词拼写 #204

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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