babel-transform-webpack-plugin
Version:
A webpack plugin to transform javascript chunks using babel.
1 lines • 19.8 kB
Source Map (JSON)
{"version":3,"file":"esm/index.mjs","sources":["webpack://babel-transform-webpack-plugin/./src/p-map/index.js","webpack://babel-transform-webpack-plugin/./src/index.ts"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet runningMappersCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\trunningMappersCount++;\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\trunningMappersCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n","import os from \"os\";\nimport { transformAsync } from \"@babel/core\";\nimport type { Compiler, Compilation } from \"webpack\";\nimport pMap from \"./p-map\";\nimport type { BabelTransformPluginOptions } from \"./type\";\n\n/**\n * 使用 Babel 转换 Webpack 资源的插件\n * 兼容 Webpack 4 和 Webpack 5\n */\nclass BabelTransformPlugin {\n\tisWebpack5 = false;\n\n\t#options: BabelTransformPluginOptions;\n\n\tconstructor(options: BabelTransformPluginOptions = {}) {\n\t\tthis.#options = options || {};\n\t}\n\n\tapply(compiler: Compiler) {\n\t\tconst { webpack } = compiler;\n\t\tthis.isWebpack5 = webpack && webpack.version.startsWith(\"5\");\n\n\t\tif (this.isWebpack5) {\n\t\t\t// Webpack 5 逻辑\n\t\t\tthis.applyWebpack5(compiler);\n\t\t} else {\n\t\t\t// Webpack 4 逻辑\n\t\t\tthis.applyWebpack4(compiler);\n\t\t}\n\t}\n\n\t/**\n\t * Webpack 5 实现(使用 processAssets)\n\t */\n\tprivate applyWebpack5(compiler: Compiler) {\n\t\tcompiler.hooks.thisCompilation.tap(\"BabelTransformPlugin\", (compilation: Compilation) => {\n\t\t\tcompilation.hooks.processAssets.tapPromise(\n\t\t\t\t{\n\t\t\t\t\tname: \"BabelTransformPlugin\",\n\t\t\t\t\tstage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE,\n\t\t\t\t},\n\t\t\t\tasync (assets) => {\n\t\t\t\t\tawait this.processAllAssets(compiler, compilation, assets);\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Webpack 4 实现(使用 optimize-chunk-assets)\n\t */\n\tprivate applyWebpack4(compiler: Compiler) {\n\t\tcompiler.hooks.compilation.tap(\"BabelTransformPlugin\", (compilation: Compilation) => {\n\t\t\t// Webpack 4 没有 processAssets,使用 optimizeChunkAssets\n\t\t\tcompilation.hooks.optimizeChunkAssets.tapPromise(\"BabelTransformPlugin\", async (chunks) => {\n\t\t\t\tconst assets: Record<string, any> = {};\n\t\t\t\tchunks.forEach((chunk) => {\n\t\t\t\t\tchunk.files.forEach((file) => {\n\t\t\t\t\t\tassets[file] = compilation.assets[file];\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tawait this.processAllAssets(compiler, compilation, assets);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * 处理所有资源(公共方法)\n\t */\n\tprivate async processAllAssets(compiler: Compiler, compilation: Compilation, assets: Record<string, any>): Promise<void> {\n\t\tconst javascriptFiles = Object.keys(assets).filter(\n\t\t\t(filename) => filename.endsWith(\".js\") && (this.#options.filter ? this.#options.filter?.(filename) : true)\n\t\t);\n\n\t\tconst process = async (filename: string) => {\n\t\t\tconst originalSource = assets[filename].source();\n\t\t\tconst sourceStr: string = typeof originalSource === \"string\" ? originalSource : originalSource.toString();\n\n\t\t\tconst modifiedSource = await this.replaceContent(compiler, sourceStr, filename);\n\n\t\t\tif (modifiedSource === sourceStr) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Webpack 4/5 通用的更新资源方式\n\t\t\tif (this.isWebpack5) {\n\t\t\t\t// 更新资源\n\t\t\t\tcompilation.updateAsset(filename, new compiler.webpack.sources.RawSource(modifiedSource));\n\t\t\t} else {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tcompilation.assets[filename] = {\n\t\t\t\t\tsource: () => modifiedSource,\n\t\t\t\t\tsize: () => modifiedSource.length,\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tawait pMap(javascriptFiles, process, { concurrency: os.cpus().length });\n\t}\n\n\t/**\n\t * 使用 Babel 转换代码\n\t */\n\tprivate async replaceContent(compiler: Compiler, source: string, filename: string): Promise<string> {\n\t\tconst result = await transformAsync(source, {\n\t\t\tcomments: compiler.options.mode !== \"production\",\n\t\t\tconfigFile: false,\n\t\t\tbabelrc: false,\n\t\t\tbrowserslistConfigFile: false,\n\t\t\t...(this.#options.transformOptions ?? {}),\n\t\t\tfilename,\n\t\t\tast: false,\n\t\t\tcloneInputAst: false,\n\t\t\tignore: undefined,\n\t\t\tinclude: undefined,\n\t\t\texclude: undefined,\n\t\t});\n\n\t\tif (!result?.code) {\n\t\t\tthrow new Error(\"Babel transform failed\");\n\t\t}\n\n\t\treturn result.code;\n\t}\n}\n\nexport { BabelTransformPlugin };\nexport default BabelTransformPlugin;\n"],"names":["_pMap","iterable","mapper","_ref","concurrency","stopOnError","signal","Number","Promise","resolve_","reject_","undefined","Symbol","TypeError","_type_of","result","errors","skippedIndexesMap","Map","isRejected","isResolved","isIterableDone","resolvingCount","currentIndex","iterator","signalListener","reject","cleanup","resolve","value","reason","next","nextItem","index","pureResult","_iteratorError","index1","AggregateError","pMapSkip","element","error","error1","_options","BabelTransformPlugin","options","apply","compiler","webpack","applyWebpack5","compilation","assets","applyWebpack4","chunks","chunk","file","processAllAssets","javascriptFiles","process","Object","filename","_class_private_field_get_filter","originalSource","sourceStr","modifiedSource","pMap","os","replaceContent","source","_class_private_field_get_transformOptions","transformAsync","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAe,SAAeA,KAC7BC,QAAQ,EACRC,MAAM;WAFuBF,MAAAA,KAAAA,CAAAA,IAAAA,EAAAA;;SAAAA;IAAAA,QAAf,6BACdC,QAAQ,EACRC,MAAM;YACNC,MAAAA,kBACCC,aAAAA,kBACAC,aACAC;;;YAHDH,OAAAA,WAAAA,MAAAA,GAAAA,KAAAA,AAAAA,KAAAA,MAAAA,UAAAA,CAAAA,EAAAA,GAAAA,UAAAA,CAAAA,EAAAA,GAII,CAAC,sBAJLA,KACCC,WAAW,EAAXA,cAAc,AAAdA,KAAAA,MAAc,mBAAAG,OAAO,iBAAiB,wCADvCJ,KAECE,WAAW,EAAXA,cAAc,AAAdA,KAAAA,MAAc,4CACdC,SAHDH,KAGCG,MAAM;YAGP,OAAO;;gBAAA,IAAIE,QAAQ,SAACC,QAAQ,EAAEC,OAAO;oBACpC,IAAIT,AAA8BU,KAAAA,MAA9BV,QAAQ,CAACW,OAAO,QAAQ,CAAC,IAAkBX,AAAmCU,KAAAA,MAAnCV,QAAQ,CAACW,OAAO,aAAa,CAAC,EAC5E,MAAM,IAAIC,UAAW,wEAA6F,OAAhBC,AAAOb,WA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