MCPcopy
hub / github.com/sonofmagic/weapp-tailwindcss / transformJs

Function transformJs

packages/weapp-tailwindcss/src/core.ts:195–210  ·  view source on GitHub ↗
(rawJs: string, options?: RuntimeJsTransformOptions)

Source from the content-addressed store, hash-verified

193 }
194
195 async function transformJs(rawJs: string, options?: RuntimeJsTransformOptions) {
196 await runtimeState.readyPromise
197 if (options?.runtimeSet) {
198 runtimeSet = options.runtimeSet
199 }
200 else if (runtimeSet.size === 0) {
201 runtimeSet = await ensureRuntimeClassSet(runtimeState, {
202 forceCollect: true,
203 })
204 }
205 const resolvedOptions = resolveTransformJsOptions(options)
206 if (shouldSkipJsTransform(rawJs, resolvedOptions)) {
207 return { code: rawJs }
208 }
209 return await jsHandler(rawJs, runtimeSet, resolvedOptions)
210 }
211
212 async function transformWxml(rawWxml: string, options?: ITemplateHandlerOptions) {
213 await runtimeState.readyPromise

Callers 3

matchSnapFunction · 0.50
compileScriptsFunction · 0.50
compileTsFilesFunction · 0.50

Calls 4

ensureRuntimeClassSetFunction · 0.90
shouldSkipJsTransformFunction · 0.90
jsHandlerFunction · 0.85

Tested by 1

matchSnapFunction · 0.40