evanw/esbuild
### [`v0.16.12`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01612)
[Compare Source](https://togithub.com/evanw/esbuild/compare/v0.16.11...v0.16.12)
- Loader defaults to `js` for extensionless files ([#2776](https://togithub.com/evanw/esbuild/issues/2776))
Certain packages contain files without an extension. For example, the `yargs` package contains the file `yargs/yargs` which has no extension. Node, Webpack, and Parcel can all understand code that imports `yargs/yargs` because they assume that the file is JavaScript. However, esbuild was previously unable to understand this code because it relies on the file extension to tell it how to interpret the file. With this release, esbuild will now assume files without an extension are JavaScript files. This can be customized by setting the loader for `""` (the empty string, representing files without an extension) to another loader. For example, if you want files without an extension to be treated as CSS instead, you can do that like this:
- CLI:
esbuild --bundle --loader:=css
- JS:
```js
esbuild.build({
bundle: true,
loader: { '': 'css' },
})
```
- Go:
```go
api.Build(api.BuildOptions{
Bundle: true,
Loader: map[string]api.Loader{"": api.LoaderCSS},
})
```
In addition, the `"type"` field in `package.json` files now only applies to files with an explicit `.js`, `.jsx`, `.ts`, or `.tsx` extension. Previously it was incorrectly applied by esbuild to all files that had an extension other than `.mjs`, `.mts`, `.cjs`, or `.cts` including extensionless files. So for example an extensionless file in a `"type": "module"` package is now treated as CommonJS instead of ESM.
Configuration
📅 Schedule: Branch creation - "before 3am on Monday" (UTC), 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.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
^0.16.11
->^0.16.12
Release Notes
evanw/esbuild
### [`v0.16.12`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01612) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.16.11...v0.16.12) - Loader defaults to `js` for extensionless files ([#2776](https://togithub.com/evanw/esbuild/issues/2776)) Certain packages contain files without an extension. For example, the `yargs` package contains the file `yargs/yargs` which has no extension. Node, Webpack, and Parcel can all understand code that imports `yargs/yargs` because they assume that the file is JavaScript. However, esbuild was previously unable to understand this code because it relies on the file extension to tell it how to interpret the file. With this release, esbuild will now assume files without an extension are JavaScript files. This can be customized by setting the loader for `""` (the empty string, representing files without an extension) to another loader. For example, if you want files without an extension to be treated as CSS instead, you can do that like this: - CLI: esbuild --bundle --loader:=css - JS: ```js esbuild.build({ bundle: true, loader: { '': 'css' }, }) ``` - Go: ```go api.Build(api.BuildOptions{ Bundle: true, Loader: map[string]api.Loader{"": api.LoaderCSS}, }) ``` In addition, the `"type"` field in `package.json` files now only applies to files with an explicit `.js`, `.jsx`, `.ts`, or `.tsx` extension. Previously it was incorrectly applied by esbuild to all files that had an extension other than `.mjs`, `.mts`, `.cjs`, or `.cts` including extensionless files. So for example an extensionless file in a `"type": "module"` package is now treated as CommonJS instead of ESM.Configuration
📅 Schedule: Branch creation - "before 3am on Monday" (UTC), 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.
This PR has been generated by Mend Renovate. View repository job log here.