From 588b99515958ad693070d0522d73cd978805166b Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 21 Oct 2025 18:38:19 -0700 Subject: [PATCH 1/2] CommonJS to target ES2019 --- CHANGELOG.md | 8 ++++++ .../tsup.config.ts | 27 ++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f702f23..3738440d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Changed ECMAScript target version, by [@compulim](https://github.com/compulim), in PR [#XXX](https://github.com/compulim/react-chain-of-responsibility/pull/XXX) + - CommonJS will target ES2019, changed from ESNext, will support Webpack 4 + - ES Modules will continue to target ESNext + ## [0.4.0] - 2025-10-22 ### Added diff --git a/packages/react-chain-of-responsibility/tsup.config.ts b/packages/react-chain-of-responsibility/tsup.config.ts index d5c31d40..9e65407b 100644 --- a/packages/react-chain-of-responsibility/tsup.config.ts +++ b/packages/react-chain-of-responsibility/tsup.config.ts @@ -1,15 +1,24 @@ -import { defineConfig } from 'tsup'; +import { defineConfig, type Options } from 'tsup'; + +const BASE_CONFIG: Options = { + dts: true, + entry: { + 'react-chain-of-responsibility': './src/index.ts', + 'react-chain-of-responsibility.fluentUI': './src/index.fluentUI.ts', + 'react-chain-of-responsibility.preview': './src/index.preview.ts' + }, + sourcemap: true +}; export default defineConfig([ { - dts: true, - entry: { - 'react-chain-of-responsibility': './src/index.ts', - 'react-chain-of-responsibility.fluentUI': './src/index.fluentUI.ts', - 'react-chain-of-responsibility.preview': './src/index.preview.ts' - }, - format: ['cjs', 'esm'], - sourcemap: true, + ...BASE_CONFIG, + format: ['esm'], target: 'esnext' + }, + { + ...BASE_CONFIG, + format: ['cjs'], + target: 'es2019' } ]); From 087d9d4889f5f5e7846fd8ae8c99445ab70e92b3 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 21 Oct 2025 18:49:06 -0700 Subject: [PATCH 2/2] Update PR number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3738440d..95ef6bb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Changed ECMAScript target version, by [@compulim](https://github.com/compulim), in PR [#XXX](https://github.com/compulim/react-chain-of-responsibility/pull/XXX) +- Changed ECMAScript target version, by [@compulim](https://github.com/compulim), in PR [#108](https://github.com/compulim/react-chain-of-responsibility/pull/108) - CommonJS will target ES2019, changed from ESNext, will support Webpack 4 - ES Modules will continue to target ESNext