Releases: privatenumber/esbuild-loader
Releases · privatenumber/esbuild-loader
v3.0.1
v3.0.0
3.0.0 (2023-02-08)
Migration guide
ESBuildMinifyPlugin
was renamed toEsbuildPlugin
to indicate it can be used as a general interface to esbuild (not just a minifier, but transformer).
ImportEsbuildPlugin
instead:
- const { ESBuildMinifyPlugin } = require('esbuild-loader')
+ const { EsbuildPlugin } = require('esbuild-loader')
- For
.js
,.jsx
,.ts
,.tsx
,.css
files, you no longer need to set theloader
option becauseesbuild-loader
can now detect how to handle them based on the extension. This also means you can consolidateesbuild-loader
rules for different file types into one, rather than hard-coding how to load each extension type.
module: {
rules: [
{
test: /\.[tj]sx?$/,
loader: 'esbuild-loader',
options: {
target: 'es2015',
- loader: 'tsx',
},
},
],
},
👉 Note: For this to work, make sure to follow file extension conventions such as using
.jsx
/.tsx
for files that contain JSX.
-
You can now use the
tsconfig
property to pass in a tsconfig file, and it will even resolveextends
-
tsconfig.json
includes
/excludes
/files
are now respected so it will only apply thetsconfig.json
to matching files. However, TypeScript compilation will always work regardless oftsconfig.json
. -
If Webpack's target is
web
,EsbuildPlugin
will default to usingformat: iife
unless otherwise specified. This change was made to prevent window pollution. -
Make sure your Node.js version is at least v16
Changes
Bug Fixes
Build System
Code Refactoring
- esbuild to auto-detect which loader to use (#304) (378c74e)
- remove
sourcemap
option (#305) (53cbc73) - rename
ESBuildMinifyPlugin
toEsbuildPlugin
(#307) (b052cdd)
Continuous Integration
Features
tsconfig
option (#311) (92b49e9)- enhanced tsconfig loading behavior (#309) (c6bb06e)
- plugin: default
format
toiife
(a9e8e7e)
BREAKING CHANGES
tsconfig.json
is now only applied to files it matches (viainclude
/exclude
/files
)- plugin: Plugin default format is now
iife
when Webpack's target isweb
& esbuild's target is belowesnext
ESBuildMinifyPlugin
renamed toEsbuildPlugin
;MinifyPluginOptions
renamed toEsbuildPluginOptions
sourcemap
option removed- Default value of loader now auto-detects which loader to use based on the extension of the file
- Increase supported Node.js to v16
- exports map and bundled files