From 025282d080eb21ef36b2fcf037520b43d9f5e0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=92=E7=8B=92=E7=A5=9E?= Date: Thu, 2 Sep 2021 14:57:48 +0800 Subject: [PATCH] release(rax): v1.2.2 compat react bundle path (#2231) * chore: revert change * chore: bump version * chore: bump version * chore: add comment --- packages/rax/CHANGELOG.md | 4 ++++ packages/rax/package.json | 2 +- scripts/dist-core.js | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/rax/CHANGELOG.md b/packages/rax/CHANGELOG.md index ce3efd6e3..2a0b9d658 100644 --- a/packages/rax/CHANGELOG.md +++ b/packages/rax/CHANGELOG.md @@ -1,5 +1,9 @@ ## CHANGELOG +### 1.2.2 + +- fix: `lib/compat` bundle error path + ### 1.2.1 - refactor: change output result format, avoid mixing `IIFE` and `CJS` diff --git a/packages/rax/package.json b/packages/rax/package.json index 07aa8d396..3d3ad702d 100644 --- a/packages/rax/package.json +++ b/packages/rax/package.json @@ -1,6 +1,6 @@ { "name": "rax", - "version": "1.2.1", + "version": "1.2.2", "description": "A universal React-compatible render engine.", "license": "BSD-3-Clause", "main": "index.js", diff --git a/scripts/dist-core.js b/scripts/dist-core.js index 2d0f6d9bd..56f510d57 100755 --- a/scripts/dist-core.js +++ b/scripts/dist-core.js @@ -176,12 +176,14 @@ buildCorePackages({ }); // Build rax compat react version to rax/lib/compat/index.js +// It needs external ../../index, which won't bundle rax into lib/compat/index.js +// If bundle rax into lib/compat/index.js, it will exist multiple version rax in the project with rax and react are used together build({ packageName: 'rax', name: 'Rax', entry: 'src/compat/index.js', outputPath: './packages/rax/lib/compat/index.js', format: CJS, - external: ['rax-children', 'rax-is-valid-element', 'rax-create-factory', 'rax-clone-element'], + external: ['../../index', 'rax-children', 'rax-is-valid-element', 'rax-create-factory', 'rax-clone-element'], replaceValues: { 'process.env.RAX_VERSION': raxVersion }, });