Tags: vercel/ncc
Tags
fix(cjs-build): enable evaluating import.meta in cjs build (#1236) ## Purpose A while ago, a [PR](#897) was merged to disable `import.meta` evaluation altogether to support new versions of Webpack. This sometimes causes issues in CJS projects. In the comments, there were some [discussions](#897 (comment)) about whether we should have a conditional and keep the previous behavior for CJS builds. This PR addresses exactly this by translating `import.meta.url` to a CJS compatible statement which results to the same output. I have created a [comparative build](https://github.com/meienberger/ncc/pull/1/files) between two projects using the same code and a dependency (@sentry/node) that uses `import.meta.url`. You can see the difference in the output `index.js` Before the change: ```javascript const importMetaUrl = typeof import.meta.url !== 'undefined' ? import.meta.url : undefined; ``` After: ```javascript const importMetaUrl = typeof require("url").pathToFileURL(__filename).href !== 'undefined' ? require("url").pathToFileURL(__filename).href : undefined; ``` Closes #1019
fix: add missing `--asset-builds` to cli help message (#1228) The `-a, --asset-builds` do exists and is useful in some circumstances(#1049), but it seems that the cli help message does not contain its usage description ( while `README.md` has the description). This PR add the description of `--asset-builds` to the cli help message. --------- Co-authored-by: Steven <steven@ceriously.com>
feat: add support for TypeScript 5.0's array extends in tsconfig (#1105) - add support for TypeScript 5.0's array extends in tsconfig - drop support for Node.js 14 - remove tests for Tensorflow - update most dependencies --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Steven <steven@ceriously.com>
PreviousNext