Skip to content

v3.0.0

Compare
Choose a tag to compare
@privatenumber privatenumber released this 08 Feb 04:03
· 79 commits to master since this release

3.0.0 (2023-02-08)

Migration guide

  • ESBuildMinifyPlugin was renamed to EsbuildPlugin to indicate it can be used as a general interface to esbuild (not just a minifier, but transformer).
    Import EsbuildPlugin instead:
- const { ESBuildMinifyPlugin } = require('esbuild-loader')
+ const { EsbuildPlugin } = require('esbuild-loader')
  • For .js, .jsx, .ts, .tsx, .css files, you no longer need to set the loader option because esbuild-loader can now detect how to handle them based on the extension. This also means you can consolidate esbuild-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 resolve extends

  • tsconfig.json includes/excludes/files are now respected so it will only apply the tsconfig.json to matching files. However, TypeScript compilation will always work regardless of tsconfig.json.

  • If Webpack's target is web, EsbuildPlugin will default to using format: 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

  • apply tsconfig only to matching files (#310) (7c68769)

Build System

  • add exports map and bundle with pkgroll (#265) (f907edd)

Code Refactoring

Continuous Integration

Features

BREAKING CHANGES

  • tsconfig.json is now only applied to files it matches (via include/exclude/files)
  • plugin: Plugin default format is now iife when Webpack's target is web & esbuild's target is below esnext
  • ESBuildMinifyPlugin renamed to EsbuildPlugin; MinifyPluginOptions renamed to EsbuildPluginOptions
  • 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