Skip to content

major: output ESM for .mjs or "type": "module" builds#720

Merged
kodiakhq[bot] merged 24 commits intomainfrom
esm-output
Jul 16, 2021
Merged

major: output ESM for .mjs or "type": "module" builds#720
kodiakhq[bot] merged 24 commits intomainfrom
esm-output

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

@guybedford guybedford commented Jun 26, 2021

This adds support to ncc for a new esm option to output ES modules from the build. It defaults to true when the input file is ".mjs" or the input file is contained within a "type": "module" boundary.

The support is based on Webpack's experimental support which seems to have a few edge cases that I have posted in webpack/webpack#13639.

If releasing this feature it would be best to treat it as having an experimental status just like the Webpack feature it exposes.

Resolves #679.

To be merged after #723 and vercel/webpack-asset-relocator-loader#140, #724.

@guybedford guybedford requested review from Timer and styfle as code owners June 26, 2021 00:18
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #720 (6e0e2f1) into main (a529543) will increase coverage by 0.16%.
The diff coverage is 100.00%.

❗ Current head 6e0e2f1 differs from pull request most recent head 00abd7b. Consider uploading reports for the commit 00abd7b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
+ Coverage   73.52%   73.69%   +0.16%     
==========================================
  Files          13       13              
  Lines         476      479       +3     
==========================================
+ Hits          350      353       +3     
  Misses        126      126              
Impacted Files Coverage Δ
src/cli.js 63.27% <100.00%> (+0.41%) ⬆️
src/index.js 79.58% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a529543...00abd7b. Read the comment docs.

Comment thread src/cli.js Outdated
@guybedford
Copy link
Copy Markdown
Contributor Author

I've rebased this PR to the webpack update at #723.

@guybedford guybedford force-pushed the esm-output branch 3 times, most recently from f0db790 to bade59e Compare July 5, 2021 20:59
@guybedford guybedford changed the title --esm flag for emitting es modules Output ESM for .mjs or "type": "module" builds Jul 5, 2021
Comment thread src/index.js Outdated
Comment thread src/index.js
Comment thread src/index.js
@guybedford
Copy link
Copy Markdown
Contributor Author

guybedford commented Jul 7, 2021

There is one last remaining failure here I'm pretty sure is a Webpack bug. (fixed by #724)

To replicate, clone the repo and run:

./src/cli.js build test/fixtures/interop-test.mjs -o bug && node bug/index.mjs

This gives the error:

const external_assert_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert");
                                        ^

ReferenceError: __WEBPACK_EXTERNAL_createRequire is not defined

where the contents of that file are:

/******/ var __webpack_modules__ = ({

/***/ 181:
/***/ ((__unused_webpack_module, exports) => {

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.s = 's';
exports['com' + 'puted'] = 'y';
exports.default = 'z';



/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/ 
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ 	// Check if module is in cache
/******/ 	var cachedModule = __webpack_module_cache__[moduleId];
/******/ 	if (cachedModule !== undefined) {
/******/ 		return cachedModule.exports;
/******/ 	}
/******/ 	// Create a new module (and put it into the cache)
/******/ 	var module = __webpack_module_cache__[moduleId] = {
/******/ 		// no module.id needed
/******/ 		// no module.loaded needed
/******/ 		exports: {}
/******/ 	};
/******/ 
/******/ 	// Execute the module function
/******/ 	var threw = true;
/******/ 	try {
/******/ 		__webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
/******/ 		threw = false;
/******/ 	} finally {
/******/ 		if(threw) delete __webpack_module_cache__[moduleId];
/******/ 	}
/******/ 
/******/ 	// Return the exports of the module
/******/ 	return module.exports;
/******/ }
/******/ 
/************************************************************************/
/******/ /* webpack/runtime/compat */
/******/ 
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";

;// CONCATENATED MODULE: external "assert"
const external_assert_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert");
// EXTERNAL MODULE: ./test/fixtures/interop.cjs
var interop = __nccwpck_require__(181);
;// CONCATENATED MODULE: ./test/fixtures/interop-test.mjs



(0,external_assert_namespaceObject.strictEqual)(interop.s, 's');
(0,external_assert_namespaceObject.strictEqual)(/* __esModule */true, true);
(0,external_assert_namespaceObject.strictEqual)(interop.default, 'z');
(0,external_assert_namespaceObject.strictEqual)(interop.s, 's');

})();

Copy link
Copy Markdown
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try that?

Comment thread src/index.js Outdated
@guybedford guybedford requested a review from sokra July 7, 2021 17:40
@guybedford
Copy link
Copy Markdown
Contributor Author

Tests are failing here pending webpack bug webpack/webpack#13744.

Comment thread src/cli.js Outdated
Comment thread src/cli.js Outdated
Comment thread src/cli.js
const buildFile = eval("require.resolve")(resolve(args._[1] || "."));
const ext = buildFile.endsWith('.cjs') ? '.cjs' : '.js';
const esm = buildFile.endsWith('.mjs') || buildFile.endsWith('.js') && hasTypeModule(buildFile);
const ext = buildFile.endsWith('.cjs') ? '.cjs' : esm && (buildFile.endsWith('.mjs') || !hasTypeModule(buildFile)) ? '.mjs' : '.js';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why you didn't decide to preserve the extension of the input file?

I would expect this:

.cjs => .cjs
.mjs => .mjs
.js => .js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Style we do keep the extension so that .cjs -> .cjs and .mjs -> .mjs. The issue with .js is that it will be read by webpack as supporting both CJS and ESM, so isn't enough information on its own, hence the boundary check.

Comment thread src/cli.js Outdated
Copy link
Copy Markdown
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! 🎉

@styfle styfle enabled auto-merge (squash) July 12, 2021 22:45
@styfle styfle changed the title Output ESM for .mjs or "type": "module" builds major: output ESM for .mjs or "type": "module" builds Jul 12, 2021
@styfle styfle added the automerge Automatically merge PR once checks pass label Jul 12, 2021
sokra
sokra previously requested changes Jul 13, 2021
Comment thread src/cli.js Outdated
Comment thread src/index.js Outdated
@guybedford
Copy link
Copy Markdown
Contributor Author

Thanks @sokra for the review, updated.

@styfle styfle requested a review from sokra July 13, 2021 13:40
@styfle styfle disabled auto-merge July 16, 2021 20:49
@styfle styfle dismissed sokra’s stale review July 16, 2021 20:49

Changes are addressed

@kodiakhq kodiakhq Bot merged commit 8481ca9 into main Jul 16, 2021
@kodiakhq kodiakhq Bot deleted the esm-output branch July 16, 2021 20:49
chhe pushed a commit to chhe/act_runner that referenced this pull request May 1, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@vercel/ncc](https://github.com/vercel/ncc) | [`^0.24.1` → `^0.38.0`](https://renovatebot.com/diffs/npm/@vercel%2fncc/0.24.1/0.38.4) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@vercel%2fncc/0.38.4?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vercel%2fncc/0.24.1/0.38.4?slim=true) |

---

### Release Notes

<details>
<summary>vercel/ncc (@&#8203;vercel/ncc)</summary>

### [`v0.38.4`](https://github.com/vercel/ncc/releases/tag/0.38.4)

[Compare Source](vercel/ncc@0.38.3...0.38.4)

##### Bug Fixes

- **cjs-build:** enable evaluating import.meta in cjs build ([#&#8203;1236](vercel/ncc#1236)) ([e72d34d](vercel/ncc@e72d34d)), closes [/github.com/vercel/ncc/pull/897#discussion\_r836916315](https://github.com//github.com/vercel/ncc/pull/897/issues/discussion_r836916315) [#&#8203;1019](vercel/ncc#1019)

### [`v0.38.3`](https://github.com/vercel/ncc/releases/tag/0.38.3)

[Compare Source](vercel/ncc@0.38.2...0.38.3)

##### Bug Fixes

- add missing `--asset-builds` to cli help message ([#&#8203;1228](vercel/ncc#1228)) ([84f8c52](vercel/ncc@84f8c52))

### [`v0.38.2`](https://github.com/vercel/ncc/releases/tag/0.38.2)

[Compare Source](vercel/ncc@0.38.1...0.38.2)

##### Bug Fixes

- **deps:** update webpack to v5.94.0, terser to v5.33.0 ([#&#8203;1213](vercel/ncc#1213)) ([158a1fd](vercel/ncc@158a1fd)), closes [#&#8203;1193](vercel/ncc#1193) [#&#8203;1194](vercel/ncc#1194) [#&#8203;1177](vercel/ncc#1177) [#&#8203;1204](vercel/ncc#1204) [#&#8203;1195](vercel/ncc#1195)

Huge thanks to [@&#8203;theoludwig](https://github.com/theoludwig) 🎉

### [`v0.38.1`](https://github.com/vercel/ncc/releases/tag/0.38.1)

[Compare Source](vercel/ncc@0.38.0...0.38.1)

##### Bug Fixes

- sourcemap sources removes webpack path ([#&#8203;1122](vercel/ncc#1122)) ([ce5984e](vercel/ncc@ce5984e)), closes [#&#8203;1011](vercel/ncc#1011) [#&#8203;1121](vercel/ncc#1121)

### [`v0.38.0`](https://github.com/vercel/ncc/releases/tag/0.38.0)

[Compare Source](vercel/ncc@0.37.0...0.38.0)

##### Features

- Log minification error when `--debug` ([#&#8203;1102](vercel/ncc#1102)) ([e2779f4](vercel/ncc@e2779f4))

### [`v0.37.0`](https://github.com/vercel/ncc/releases/tag/0.37.0)

[Compare Source](vercel/ncc@0.36.1...0.37.0)

##### Features

- add support for TypeScript 5.0's array extends in tsconfig ([#&#8203;1105](vercel/ncc#1105)) ([f898f8e](vercel/ncc@f898f8e))

### [`v0.36.1`](https://github.com/vercel/ncc/releases/tag/0.36.1)

[Compare Source](vercel/ncc@0.36.0...0.36.1)

##### Bug Fixes

- add missing pr title lint action ([#&#8203;1032](vercel/ncc#1032)) ([c2d03cf](vercel/ncc@c2d03cf))
- add `ncc --version` and `ncc --help` ([#&#8203;1030](vercel/ncc#1030)) ([d38b619](vercel/ncc@d38b619))

### [`v0.36.0`](https://github.com/vercel/ncc/releases/tag/0.36.0)

[Compare Source](vercel/ncc@0.34.0...0.36.0)

##### Bug Fixes

- gitignore should include release.config.js ([#&#8203;1016](vercel/ncc#1016)) ([44e2eac](vercel/ncc@44e2eac))
- node 18 by update source-map used by Terser to 0.7.4 ([#&#8203;999](vercel/ncc#999)) ([2f69f83](vercel/ncc@2f69f83))

##### Features

- add semantic-release to autopublish ([#&#8203;1015](vercel/ncc#1015)) ([be3405d](vercel/ncc@be3405d)), closes [#&#8203;1000](vercel/ncc#1000)

### [`v0.34.0`](https://github.com/vercel/ncc/releases/tag/0.34.0)

[Compare Source](vercel/ncc@0.33.4...0.34.0)

##### Changes

Add support for TS 4.7

- Chore(deps-dev): bump ts-loader from 8.3.0 to 9.3.0: [#&#8203;921](vercel/ncc#921)
- Chore(deps-dev): bump express from 4.17.1 to 4.18.1: [#&#8203;917](vercel/ncc#917)
- Chore: add `memory-fs` to the devDependencies: [#&#8203;927](vercel/ncc#927)

##### Credits

Huge thanks to [@&#8203;stscoundrel](https://github.com/stscoundrel) and [@&#8203;shogo82148](https://github.com/shogo82148) for helping!

### [`v0.33.4`](https://github.com/vercel/ncc/releases/tag/0.33.4)

[Compare Source](vercel/ncc@0.33.3...0.33.4)

##### Changes

- Fix: Add missing variable declaration: [#&#8203;773](vercel/ncc#773)
- Chore: add windows to CI: [#&#8203;896](vercel/ncc#896)
- Chore: bump webpack-asset-relocator-loader to 1.7.2: [#&#8203;912](vercel/ncc#912)
- Chore(deps-dev): bump vm2 from 3.9.4 to 3.9.6: [#&#8203;872](vercel/ncc#872)
- Chore(deps): bump url-parse from 1.5.3 to 1.5.7: [#&#8203;875](vercel/ncc#875)
- Chore(deps): bump url-parse from 1.5.7 to 1.5.10: [#&#8203;879](vercel/ncc#879)
- Chore(deps-dev): bump stripe from 8.167.0 to 8.205.0: [#&#8203;882](vercel/ncc#882)
- Chore(deps-dev): bump typescript from 4.4.2 to 4.6.2: [#&#8203;881](vercel/ncc#881)
- Chore(deps-dev): bump twilio from 3.66.1 to 3.75.0: [#&#8203;884](vercel/ncc#884)
- Chore(deps): bump actions/setup-node from 2 to 3: [#&#8203;880](vercel/ncc#880)
- Chore(deps-dev): bump graphql from 15.5.1 to 15.8.0: [#&#8203;885](vercel/ncc#885)
- Chore: replace deprecated String.prototype.substr(): [#&#8203;894](vercel/ncc#894)
- Chore(deps): bump actions/checkout from 2 to 3: [#&#8203;902](vercel/ncc#902)
- Chore(deps-dev): bump [@&#8203;azure/cosmos](https://github.com/azure/cosmos) from 3.12.3 to 3.15.1: [#&#8203;905](vercel/ncc#905)
- Chore(deps-dev): bump stripe from 8.205.0 to 8.214.0: [#&#8203;906](vercel/ncc#906)
- Chore(deps-dev): bump [@&#8203;google-cloud/bigquery](https://github.com/google-cloud/bigquery) from 5.7.0 to 5.12.0: [#&#8203;903](vercel/ncc#903)
- Chore(deps-dev): bump tsconfig-paths from 3.10.1 to 3.14.1: [#&#8203;904](vercel/ncc#904)

##### Credits

Huge thanks to [@&#8203;CommanderRoot](https://github.com/CommanderRoot) for helping!

### [`v0.33.3`](https://github.com/vercel/ncc/releases/tag/0.33.3)

[Compare Source](vercel/ncc@0.33.2...0.33.3)

##### Patches

- Fix: bump license-webpack-plugin: [#&#8203;871](vercel/ncc#871)
- Chore(deps): bump follow-redirects from 1.14.7 to 1.14.8: [#&#8203;870](vercel/ncc#870)

### [`v0.33.2`](https://github.com/vercel/ncc/releases/tag/0.33.2)

[Compare Source](vercel/ncc@0.33.1...0.33.2)

##### Patches

- Fix: use `sha256` instead of deprecated `md5` for hash algorithm: [#&#8203;868](vercel/ncc#868)
- Fix: typo in build script: [#&#8203;835](vercel/ncc#835)
- Chore(test) Add Node.js 16 to CI: [#&#8203;801](vercel/ncc#801)
- Chore(deps): bump nodemailer from 6.5.0 to 6.7.2: [#&#8203;833](vercel/ncc#833)
- Chore(deps-dev): bump terser from 5.7.1 to 5.10.0: [#&#8203;840](vercel/ncc#840)
- Chore(deps-dev): bump passport from 0.4.1 to 0.5.2: [#&#8203;839](vercel/ncc#839)
- Chore(deps-dev): bump sequelize from 6.6.5 to 6.12.4: [#&#8203;843](vercel/ncc#843)
- Chore(deps-dev): bump analytics-node from 5.0.0 to 6.0.0: [#&#8203;838](vercel/ncc#838)
- Chore(deps): bump follow-redirects from 1.14.5 to 1.14.7: [#&#8203;846](vercel/ncc#846)
- Chore(deps): bump cached-path-relative from 1.0.2 to 1.1.0: [#&#8203;854](vercel/ncc#854)
- Chore(deps-dev): bump license-webpack-plugin from 2.3.20 to 4.0.1: [#&#8203;859](vercel/ncc#859)
- Chore(deps): bump simple-get from 3.1.0 to 3.1.1: [#&#8203;864](vercel/ncc#864)
- Chore(deps-dev): bump aws-sdk from 2.1024.0 to 2.1068.0: [#&#8203;867](vercel/ncc#867)

##### Credits

Huge thanks to [@&#8203;shakefu](https://github.com/shakefu) for helping!

### [`v0.33.1`](https://github.com/vercel/ncc/releases/tag/0.33.1)

[Compare Source](vercel/ncc@0.33.0...0.33.1)

##### Patches

- Allow configuring mainFields for nccing browser modules: [#&#8203;832](vercel/ncc#832)

### [`v0.33.0`](https://github.com/vercel/ncc/releases/tag/0.33.0)

[Compare Source](vercel/ncc@0.32.0...0.33.0)

##### Minor Changes

- Chore(deps-dev): bump [@&#8203;vercel/webpack-asset-relocator-loader](https://github.com/vercel/webpack-asset-relocator-loader): [#&#8203;826](vercel/ncc#826)
- Fix: Fix source maps: [#&#8203;818](vercel/ncc#818)
- Feat: Allow using matches from externals for regex matching: [#&#8203;825](vercel/ncc#825)

##### Patches

- Chore(deps-dev): bump koa from 2.13.1 to 2.13.4: [#&#8203;822](vercel/ncc#822)
- Chore(deps-dev): bump mariadb from 2.5.4 to 2.5.5: [#&#8203;823](vercel/ncc#823)

##### Credits

Huge thanks to [@&#8203;fenix20113](https://github.com/fenix20113) for helping!

### [`v0.32.0`](https://github.com/vercel/ncc/releases/tag/0.32.0)

[Compare Source](vercel/ncc@0.31.1...0.32.0)

##### Changes

- Feat: bump to webpack\@&#8203;5.61.0: [#&#8203;809](vercel/ncc#809)
- Docs: add debug command description: [#&#8203;800](vercel/ncc#800)
- Chore(deps): bump object-path from 0.11.7 to 0.11.8: [#&#8203;778](vercel/ncc#778)
- Chore(deps): bump tmpl from 1.0.4 to 1.0.5: [#&#8203;779](vercel/ncc#779)
- Chore(deps-dev): bump vm2 from 3.9.3 to 3.9.4: [#&#8203;795](vercel/ncc#795)
- Chore(deps-dev): bump axios from 0.21.1 to 0.21.2: [#&#8203;810](vercel/ncc#810)
- Chore(deps-dev): bump aws-sdk from 2.958.0 to 2.1024.0: [#&#8203;812](vercel/ncc#812)
- Chore(deps-dev): bump webpack from 5.61.0 to 5.62.1: [#&#8203;813](vercel/ncc#813)
- Chore(deps): bump passport-oauth2 from 1.5.0 to 1.6.1: [#&#8203;811](vercel/ncc#811)
- Chore(deps): bump url-parse from 1.5.1 to 1.5.3: [#&#8203;815](vercel/ncc#815)

##### Credits

Huge thanks to [@&#8203;fireairforce](https://github.com/fireairforce) and [@&#8203;jesec](https://github.com/jesec) for helping!

### [`v0.31.1`](https://github.com/vercel/ncc/releases/tag/0.31.1)

[Compare Source](vercel/ncc@0.31.0...0.31.1)

##### Patches

- Fix `tsconfig.json` detection: [#&#8203;770](vercel/ncc#770)

### [`v0.31.0`](https://github.com/vercel/ncc/releases/tag/0.31.0)

[Compare Source](vercel/ncc@0.30.0...0.31.0)

##### Changes

- Fix `compilerOptions` from `tsconfig.json`: [#&#8203;766](vercel/ncc#766)
- Bump typescript to 4.4.2: [#&#8203;767](vercel/ncc#767)
- Chore(deps-dev): bump graceful-fs from 4.2.6 to 4.2.8: [#&#8203;761](vercel/ncc#761)
- Chore(deps): bump tar from 4.4.15 to 4.4.19: [#&#8203;763](vercel/ncc#763)
- Chore(deps): bump object-path from 0.11.5 to 0.11.7: [#&#8203;764](vercel/ncc#764)

### [`v0.30.0`](https://github.com/vercel/ncc/releases/tag/0.30.0)

[Compare Source](vercel/ncc@0.29.2...0.30.0)

##### Changes

- Major: Change asset builds to opt-in with new option `--asset-builds`: [#&#8203;756](vercel/ncc#756)
- Chore: bump typescript from 3.9.9 to 4.3.5: [#&#8203;739](vercel/ncc#739)
- Chore: bump codecov to 3.8.3: [#&#8203;752](vercel/ncc#752)

##### Description

Previous, `fs.readFile('./asset.js')` would compile `asset.js` instead of including as an asset.

With this release, the default behavior has been changed to include `asset.js` as an asset only.

If you want the old behavior, you can use the `--asset-builds` option.

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.29.2`](https://github.com/vercel/ncc/releases/tag/0.29.2)

[Compare Source](vercel/ncc@0.29.1...0.29.2)

##### Patches

- Fix: ensure nested builds of `__nccwpck_require__`: [#&#8203;751](vercel/ncc#751)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.29.1`](https://github.com/vercel/ncc/releases/tag/0.29.1)

[Compare Source](vercel/ncc@0.29.0...0.29.1)

##### Patches

- Fix: add stringify-loader: [#&#8203;742](vercel/ncc#742)
- Fix: package.json asset type module setting: [#&#8203;733](vercel/ncc#733)
- Chore(deps): update dependencies: [#&#8203;736](vercel/ncc#736)
- Chore(deps): bump tar from 4.4.13 to 4.4.15: [#&#8203;743](vercel/ncc#743)
- Chore(deps): bump path-parse from 1.0.6 to 1.0.7: [#&#8203;745](vercel/ncc#745)
- Chore(deps-dev): bump pdfkit from 0.12.1 to 0.12.3: [#&#8203;740](vercel/ncc#740)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford), [@&#8203;mmorel-35](https://github.com/mmorel-35), and [@&#8203;jpcloureiro](https://github.com/jpcloureiro) for helping!

### [`v0.29.0`](https://github.com/vercel/ncc/releases/tag/0.29.0)

[Compare Source](vercel/ncc@0.28.6...0.29.0)

##### Changes

- Major: output ESM for `.mjs` or `type=module` builds: [#&#8203;720](vercel/ncc#720)
- Feat: update to webpack-asset-reloactor-loader\@&#8203;1.5.0: [#&#8203;718](vercel/ncc#718)
- Feat: update to webpack\@&#8203;5.42.0: [#&#8203;723](vercel/ncc#723)
- Feat: update to webpack\@&#8203;5.43.0: [#&#8203;724](vercel/ncc#724)
- Chore: bump set-getter from 0.1.0 to 0.1.1: [#&#8203;719](vercel/ncc#719)
- Fix: typo in readme: [#&#8203;712](vercel/ncc#712)

##### Credits

Huge thanks to [@&#8203;rethab](https://github.com/rethab) and [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.28.6`](https://github.com/vercel/ncc/releases/tag/0.28.6)

[Compare Source](vercel/ncc@0.28.5...0.28.6)

##### Patches

- Fix: Update to webpack\@&#8203;5.36.2: [#&#8203;707](vercel/ncc#707)
- Fix: Update ts-loader to fix webpack warning: [#&#8203;710](vercel/ncc#710)
- Deps: Bump hosted-git-info from 2.8.8 to 2.8.9: [#&#8203;708](vercel/ncc#708)

##### Credits

Huge thanks to [@&#8203;adriencohen](https://github.com/adriencohen) and [@&#8203;huozhi](https://github.com/huozhi) for helping!

### [`v0.28.5`](https://github.com/vercel/ncc/releases/tag/0.28.5)

[Compare Source](vercel/ncc@0.28.4...0.28.5)

##### Patches

- Fix: handle terser error: [#&#8203;703](vercel/ncc#703)
- Fix: treat compilation.errors as a set: [#&#8203;705](vercel/ncc#705)
- Fix: unify `target` arg description, add `transpile-only` arg to readme: [#&#8203;702](vercel/ncc#702)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) and [@&#8203;Simek](https://github.com/Simek) for helping!

### [`v0.28.4`](https://github.com/vercel/ncc/releases/tag/0.28.4)

[Compare Source](vercel/ncc@0.28.3...0.28.4)

##### Patches

- Fix: Adjust caching to use hashes: [#&#8203;698](vercel/ncc#698)
- Fix: support top-level await: [#&#8203;700](vercel/ncc#700)
- Fix: publish should build without cache: [#&#8203;701](vercel/ncc#701)
- Chore:  redis from 2.8.0 to 3.1.1: [#&#8203;699](vercel/ncc#699)
- Chore: Bump ssri from 6.0.1 to 6.0.2: [#&#8203;695](vercel/ncc#695)
- Chore: rename master to main: [#&#8203;694](vercel/ncc#694)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.28.3`](https://github.com/vercel/ncc/releases/tag/0.28.3)

[Compare Source](vercel/ncc@0.28.2...0.28.3)

##### Patches

- Fix: lock license plugin version: [#&#8203;692](vercel/ncc#692)

##### Credits

Huge thanks to [@&#8203;huozhi](https://github.com/huozhi) for helping!

### [`v0.28.2`](https://github.com/vercel/ncc/releases/tag/0.28.2)

[Compare Source](vercel/ncc@0.28.1...0.28.2)

##### Patches

- Fix: unknown compiler option `incremental`: [#&#8203;685](vercel/ncc#685)
- Fix: replace .npmignore with "files" prop: [#&#8203;688](vercel/ncc#688)

##### Credits

Huge thanks to [@&#8203;Songkeys](https://github.com/Songkeys) for helping!

### [`v0.28.1`](https://github.com/vercel/ncc/releases/tag/0.28.1)

[Compare Source](vercel/ncc@0.28.0...0.28.1)

##### Patches

- Fix: Rebuild bundle to fix [#&#8203;684](vercel/ncc#684)
- Deps: Bump codecov to 3.8.1: [#&#8203;683](vercel/ncc#683)

### [`v0.28.0`](https://github.com/vercel/ncc/releases/tag/0.28.0)

[Compare Source](vercel/ncc@0.27.0...0.28.0)

##### Minor Changes

- Feat: `exports` conditions semantics: [#&#8203;665](vercel/ncc#665)
- Feat: `imports` support, webpack upgrade: [#&#8203;672](vercel/ncc#672)
- Feat: Support Regexp externals: [#&#8203;654](vercel/ncc#654)
- Fix: TS interop test and fix: [#&#8203;671](vercel/ncc#671)
- Fix: Upgrade local TS: [#&#8203;674](vercel/ncc#674)
- Chore: Interop test case: [#&#8203;667](vercel/ncc#667)
- Chore: add console output when minifying fails: [#&#8203;648](vercel/ncc#648)
- Chore: Add Node.js 14 to CI: [#&#8203;659](vercel/ncc#659)
- Docs: Fix out \[file] → out \[dir]: [#&#8203;675](vercel/ncc#675)
- Deps: Update to webpack\@&#8203;5.30.0: [#&#8203;681](vercel/ncc#681)
- Deps: Update to webpack\@&#8203;5.26.3: [#&#8203;664](vercel/ncc#664)
- Deps: Update to webpack\@&#8203;5.24.4: [#&#8203;658](vercel/ncc#658)
- Deps: Update to webpack-asset-relocator-loader\@&#8203;1.3.0: [#&#8203;682](vercel/ncc#682)
- Deps: Upgrade to webpack-asset-relocator-loader\@&#8203;1.2.4: [#&#8203;673](vercel/ncc#673)
- Deps: Update to webpack-asset-relocator\@&#8203;1.2.3: [#&#8203;662](vercel/ncc#662)
- Deps: Upgrade to terser\@&#8203;5.6.1: [#&#8203;669](vercel/ncc#669)
- Deps: Bump socket.io from 2.2.0 to 2.4.0: [#&#8203;645](vercel/ncc#645)
- Deps: Bump pug from 2.0.3 to 3.0.1: [#&#8203;656](vercel/ncc#656)
- Deps: Bump elliptic from 6.5.3 to 6.5.4: [#&#8203;657](vercel/ncc#657)
- Deps: Bump msgpack5 from 4.2.1 to 4.5.1: [#&#8203;660](vercel/ncc#660)
- Deps: Bump y18n from 3.2.1 to 3.2.2: [#&#8203;678](vercel/ncc#678)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford), [@&#8203;Songkeys](https://github.com/Songkeys), [@&#8203;adriencohen](https://github.com/adriencohen), and [@&#8203;huozhi](https://github.com/huozhi) for helping!

### [`v0.27.0`](https://github.com/vercel/ncc/releases/tag/0.27.0)

[Compare Source](vercel/ncc@0.26.2...0.27.0)

##### Changes

- Feat: support customEmit ncc option: [#&#8203;634](vercel/ncc#634)
- Fix: correct declaration output dir: [#&#8203;627](vercel/ncc#627)
- Update to webpack-asset-relocator\@&#8203;1.2.0: [#&#8203;640](vercel/ncc#640)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) and [@&#8203;zeroooooooo](https://github.com/zeroooooooo) for helping!

### [`v0.26.2`](https://github.com/vercel/ncc/releases/tag/0.26.2)

[Compare Source](vercel/ncc@0.26.1...0.26.2)

##### Patches

- Enable minification for sourcemap-register.js: [#&#8203;631](vercel/ncc#631)
- Avoid **webpack\_require** conflicts: [#&#8203;633](vercel/ncc#633)
- Bump axios from 0.18.1 to 0.21.1: [#&#8203;636](vercel/ncc#636)
- Fix: skip typechecking on sub-builds: [#&#8203;637](vercel/ncc#637)

##### Credits

Huge thanks to [@&#8203;xom9ikk](https://github.com/xom9ikk) and [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.26.1`](https://github.com/vercel/ncc/releases/tag/0.26.1)

[Compare Source](vercel/ncc@0.26.0...0.26.1)

##### Patches

- Ensure separate asset compilation states in subbuilds: [#&#8203;630](vercel/ncc#630)

##### Credits

Huge thanks to [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.26.0`](https://github.com/vercel/ncc/releases/tag/0.26.0)

[Compare Source](vercel/ncc@0.25.1...0.26.0)

##### Changes

- Asset subbundle builds: [#&#8203;625](vercel/ncc#625)
- Bump ini from 1.3.5 to 1.3.7: [#&#8203;624](vercel/ncc#624)
- Update example with missing TypeScript dependency: [#&#8203;623](vercel/ncc#623)
- Update readme with missing TS and ES options: [#&#8203;615](vercel/ncc#615)

##### Credits

Huge thanks to [@&#8203;restuwahyu13](https://github.com/restuwahyu13) and [@&#8203;guybedford](https://github.com/guybedford) for helping!

### [`v0.25.1`](https://github.com/vercel/ncc/releases/tag/0.25.1)

[Compare Source](vercel/ncc@0.25.0...0.25.1)

##### Changes

- Allow passing `target`: [#&#8203;614](vercel/ncc#614)

##### Credits

Huge thanks to [@&#8203;ijjk](https://github.com/ijjk) for helping!

### [`v0.25.0`](https://github.com/vercel/ncc/releases/tag/0.25.0)

[Compare Source](vercel/ncc@0.24.1...0.25.0)

##### Changes

- Bump `webpack` from `5.0.0-beta.28` to `5.2.0`: [#&#8203;602](vercel/ncc#602)
- Bump `npm-user-validate` from `1.0.0` to `1.0.1`: [#&#8203;604](vercel/ncc#604)
- Bump `object-path` from `0.11.4` to `0.11.5`: [#&#8203;607](vercel/ncc#607)
- Fix `--quiet` flag on ts build: [#&#8203;605](vercel/ncc#605)
- Add integration test for `@slack/web-api`: [#&#8203;591](vercel/ncc#591)

##### Credits

Huge thanks to [@&#8203;huozhi](https://github.com/huozhi) and [@&#8203;ataylorme](https://github.com/ataylorme) for helping!

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: Nicolas <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/881
Reviewed-by: Nicolas <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge PR once checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ES module output mode

4 participants