From 60ca2cc0d486e563a9c1e2a362a10d3ce67b2db5 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 16 Aug 2024 15:51:59 +0800 Subject: [PATCH 1/3] chore: use index as entry name --- e2e/cases/alias/rslib.config.ts | 2 +- .../type-commonjs/default/rslib.config.ts | 2 +- .../type-commonjs/false/rslib.config.ts | 2 +- .../type-module/default/rslib.config.ts | 2 +- .../type-module/false/rslib.config.ts | 2 +- e2e/cases/auto-external/default/rslib.config.ts | 2 +- .../external-sub-path/rslib.config.ts | 2 +- e2e/cases/auto-external/false/rslib.config.ts | 2 +- .../auto-external/with-externals/rslib.config.ts | 2 +- e2e/cases/bundle-false/basic/rslib.config.ts | 2 +- .../bundle-false/relative-import/rslib.config.ts | 2 +- .../bundle-false/single-file/rslib.config.ts | 2 +- e2e/cases/define/rslib.config.ts | 2 +- .../bundle-false/abort-on-error/rslib.config.ts | 2 +- .../bundle-false/auto-extension/rslib.config.ts | 2 +- e2e/cases/dts/bundle-false/basic/rslib.config.ts | 2 +- .../dts/bundle-false/dist-path/rslib.config.ts | 2 +- e2e/cases/dts/bundle-false/false/rslib.config.ts | 2 +- .../dts/bundle/abort-on-error/rslib.config.ts | 2 +- .../dts/bundle/auto-extension/rslib.config.ts | 2 +- e2e/cases/dts/bundle/basic/rslib.config.ts | 2 +- e2e/cases/dts/bundle/dist-path/rslib.config.ts | 2 +- e2e/cases/dts/bundle/false/rslib.config.ts | 2 +- e2e/cases/dts/index.test.ts | 6 +++--- e2e/cases/externals/browser/rslib.config.ts | 2 +- e2e/cases/externals/node/rslib.config.ts | 2 +- e2e/cases/shims/esm/rslib.config.ts | 2 +- e2e/cases/syntax/config/rslib.config.ts | 2 +- e2e/cases/syntax/default/rslib.config.ts | 2 +- examples/express-plugin/rslib.config.ts | 3 ++- examples/react-component/rslib.config.ts | 2 +- packages/core/bin/rslib.js | 2 +- packages/core/package.json | 4 ++-- packages/core/rslib.config.ts | 2 +- packages/core/src/config.ts | 4 ++-- packages/core/tests/config.test.ts | 16 ++++++++-------- .../tests/fixtures/config/cjs/rslib.config.cjs | 2 +- .../tests/fixtures/config/cjs/rslib.config.js | 2 +- .../tests/fixtures/config/cjs/rslib.config.mjs | 2 +- .../tests/fixtures/config/cjs/rslib.config.ts | 2 +- .../tests/fixtures/config/esm/rslib.config.cjs | 2 +- .../tests/fixtures/config/esm/rslib.config.js | 2 +- .../tests/fixtures/config/esm/rslib.config.mjs | 2 +- .../tests/fixtures/config/esm/rslib.config.ts | 2 +- packages/plugin-dts/rslib.config.ts | 2 +- 45 files changed, 57 insertions(+), 56 deletions(-) diff --git a/e2e/cases/alias/rslib.config.ts b/e2e/cases/alias/rslib.config.ts index 075d2e541..cbd40defe 100644 --- a/e2e/cases/alias/rslib.config.ts +++ b/e2e/cases/alias/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, alias: { '@src': 'src', diff --git a/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts b/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts index 03e316a7e..7d4281276 100644 --- a/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts +++ b/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: '../../__fixtures__/src/index.ts', + index: '../../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts b/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts index 271d15adf..08b5039c9 100644 --- a/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts +++ b/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: '../../__fixtures__/src/index.ts', + index: '../../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/auto-extension/type-module/default/rslib.config.ts b/e2e/cases/auto-extension/type-module/default/rslib.config.ts index 03e316a7e..7d4281276 100644 --- a/e2e/cases/auto-extension/type-module/default/rslib.config.ts +++ b/e2e/cases/auto-extension/type-module/default/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: '../../__fixtures__/src/index.ts', + index: '../../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/auto-extension/type-module/false/rslib.config.ts b/e2e/cases/auto-extension/type-module/false/rslib.config.ts index 271d15adf..08b5039c9 100644 --- a/e2e/cases/auto-extension/type-module/false/rslib.config.ts +++ b/e2e/cases/auto-extension/type-module/false/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: '../../__fixtures__/src/index.ts', + index: '../../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/auto-external/default/rslib.config.ts b/e2e/cases/auto-external/default/rslib.config.ts index 455ac5034..7a8476976 100644 --- a/e2e/cases/auto-external/default/rslib.config.ts +++ b/e2e/cases/auto-external/default/rslib.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ ], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, }); diff --git a/e2e/cases/auto-external/external-sub-path/rslib.config.ts b/e2e/cases/auto-external/external-sub-path/rslib.config.ts index 03252f356..55d7ff6cb 100644 --- a/e2e/cases/auto-external/external-sub-path/rslib.config.ts +++ b/e2e/cases/auto-external/external-sub-path/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, }); diff --git a/e2e/cases/auto-external/false/rslib.config.ts b/e2e/cases/auto-external/false/rslib.config.ts index 79f695b9a..1ffccff84 100644 --- a/e2e/cases/auto-external/false/rslib.config.ts +++ b/e2e/cases/auto-external/false/rslib.config.ts @@ -18,7 +18,7 @@ export default defineConfig({ ], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, }); diff --git a/e2e/cases/auto-external/with-externals/rslib.config.ts b/e2e/cases/auto-external/with-externals/rslib.config.ts index 6aadaf20b..62127195f 100644 --- a/e2e/cases/auto-external/with-externals/rslib.config.ts +++ b/e2e/cases/auto-external/with-externals/rslib.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ }, source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/bundle-false/basic/rslib.config.ts b/e2e/cases/bundle-false/basic/rslib.config.ts index c5d9857f1..768450350 100644 --- a/e2e/cases/bundle-false/basic/rslib.config.ts +++ b/e2e/cases/bundle-false/basic/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: ['./src/**'], + index: ['./src/**'], }, }, }); diff --git a/e2e/cases/bundle-false/relative-import/rslib.config.ts b/e2e/cases/bundle-false/relative-import/rslib.config.ts index c5d9857f1..768450350 100644 --- a/e2e/cases/bundle-false/relative-import/rslib.config.ts +++ b/e2e/cases/bundle-false/relative-import/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: ['./src/**'], + index: ['./src/**'], }, }, }); diff --git a/e2e/cases/bundle-false/single-file/rslib.config.ts b/e2e/cases/bundle-false/single-file/rslib.config.ts index c5d9857f1..768450350 100644 --- a/e2e/cases/bundle-false/single-file/rslib.config.ts +++ b/e2e/cases/bundle-false/single-file/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: ['./src/**'], + index: ['./src/**'], }, }, }); diff --git a/e2e/cases/define/rslib.config.ts b/e2e/cases/define/rslib.config.ts index bbd244727..a53a9022a 100644 --- a/e2e/cases/define/rslib.config.ts +++ b/e2e/cases/define/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, define: { VERSION: JSON.stringify('1.0.0'), diff --git a/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts b/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts index 8b29fd58b..ba3819fac 100644 --- a/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts +++ b/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ ], source: { entry: { - main: ['./src/**'], + index: ['./src/**'], }, }, }); diff --git a/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts b/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts index 8dfb9ba1c..5a87676e1 100644 --- a/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts +++ b/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ ], source: { entry: { - main: ['../__fixtures__/src/**'], + index: ['../__fixtures__/src/**'], }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle-false/basic/rslib.config.ts b/e2e/cases/dts/bundle-false/basic/rslib.config.ts index f38659d26..21f11b013 100644 --- a/e2e/cases/dts/bundle-false/basic/rslib.config.ts +++ b/e2e/cases/dts/bundle-false/basic/rslib.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ ], source: { entry: { - main: ['../__fixtures__/src/**'], + index: ['../__fixtures__/src/**'], }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts b/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts index 59cf68ee7..c719154de 100644 --- a/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts +++ b/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ ], source: { entry: { - main: ['../__fixtures__/src/**'], + index: ['../__fixtures__/src/**'], }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle-false/false/rslib.config.ts b/e2e/cases/dts/bundle-false/false/rslib.config.ts index dc88d2f0f..40a28ecaa 100644 --- a/e2e/cases/dts/bundle-false/false/rslib.config.ts +++ b/e2e/cases/dts/bundle-false/false/rslib.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ ], source: { entry: { - main: ['../__fixtures__/src/**'], + index: ['../__fixtures__/src/**'], }, }, }); diff --git a/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts b/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts index f107f48ff..4bc2722ff 100644 --- a/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts +++ b/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ ], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, tsconfigPath: 'tsconfig.json', }, diff --git a/e2e/cases/dts/bundle/auto-extension/rslib.config.ts b/e2e/cases/dts/bundle/auto-extension/rslib.config.ts index 69ca77fb6..70b3e7e87 100644 --- a/e2e/cases/dts/bundle/auto-extension/rslib.config.ts +++ b/e2e/cases/dts/bundle/auto-extension/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle/basic/rslib.config.ts b/e2e/cases/dts/bundle/basic/rslib.config.ts index ef3fd91ac..8a359becc 100644 --- a/e2e/cases/dts/bundle/basic/rslib.config.ts +++ b/e2e/cases/dts/bundle/basic/rslib.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ ], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle/dist-path/rslib.config.ts b/e2e/cases/dts/bundle/dist-path/rslib.config.ts index c7492c387..df7137be9 100644 --- a/e2e/cases/dts/bundle/dist-path/rslib.config.ts +++ b/e2e/cases/dts/bundle/dist-path/rslib.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ ], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/bundle/false/rslib.config.ts b/e2e/cases/dts/bundle/false/rslib.config.ts index f7e4a0964..427414ce6 100644 --- a/e2e/cases/dts/bundle/false/rslib.config.ts +++ b/e2e/cases/dts/bundle/false/rslib.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ ], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, tsconfigPath: '../__fixtures__/tsconfig.json', }, diff --git a/e2e/cases/dts/index.test.ts b/e2e/cases/dts/index.test.ts index bd16c95dc..da4b669c4 100644 --- a/e2e/cases/dts/index.test.ts +++ b/e2e/cases/dts/index.test.ts @@ -70,7 +70,7 @@ describe('dts when bundle: true', () => { ); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/basic/dist/esm/main.d.ts"`, + `"/e2e/cases/dts/bundle/basic/dist/esm/index.d.ts"`, ); expect(entries).toMatchSnapshot(); }); @@ -87,7 +87,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/dist-path/dist/custom/main.d.ts"`, + `"/e2e/cases/dts/bundle/dist-path/dist/custom/index.d.ts"`, ); }); @@ -103,7 +103,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.cjs).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/auto-extension/dist/cjs/main.d.cts"`, + `"/e2e/cases/dts/bundle/auto-extension/dist/cjs/index.d.cts"`, ); }); diff --git a/e2e/cases/externals/browser/rslib.config.ts b/e2e/cases/externals/browser/rslib.config.ts index b110dc60b..cdc7fe53f 100644 --- a/e2e/cases/externals/browser/rslib.config.ts +++ b/e2e/cases/externals/browser/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, output: { diff --git a/e2e/cases/externals/node/rslib.config.ts b/e2e/cases/externals/node/rslib.config.ts index ec7be0242..80e2f41b6 100644 --- a/e2e/cases/externals/node/rslib.config.ts +++ b/e2e/cases/externals/node/rslib.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ ], source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, output: { diff --git a/e2e/cases/shims/esm/rslib.config.ts b/e2e/cases/shims/esm/rslib.config.ts index 64748a916..87a676818 100644 --- a/e2e/cases/shims/esm/rslib.config.ts +++ b/e2e/cases/shims/esm/rslib.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ }, source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, }); diff --git a/e2e/cases/syntax/config/rslib.config.ts b/e2e/cases/syntax/config/rslib.config.ts index ee9a3be17..afb369907 100644 --- a/e2e/cases/syntax/config/rslib.config.ts +++ b/e2e/cases/syntax/config/rslib.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ ], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, }, }); diff --git a/e2e/cases/syntax/default/rslib.config.ts b/e2e/cases/syntax/default/rslib.config.ts index 549d8c880..57e7075ee 100644 --- a/e2e/cases/syntax/default/rslib.config.ts +++ b/e2e/cases/syntax/default/rslib.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], source: { entry: { - main: '../__fixtures__/src/index.ts', + index: '../__fixtures__/src/index.ts', }, }, }); diff --git a/examples/express-plugin/rslib.config.ts b/examples/express-plugin/rslib.config.ts index e71c9b75c..ca83666a3 100644 --- a/examples/express-plugin/rslib.config.ts +++ b/examples/express-plugin/rslib.config.ts @@ -27,9 +27,10 @@ export default defineConfig({ }, }, ], + // TODO: We can remove this after https://github.com/web-infra-dev/rsbuild/pull/3225 being merged source: { entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, output: { diff --git a/examples/react-component/rslib.config.ts b/examples/react-component/rslib.config.ts index 561d3c6e3..54817c70f 100644 --- a/examples/react-component/rslib.config.ts +++ b/examples/react-component/rslib.config.ts @@ -30,7 +30,7 @@ export default defineConfig({ ], source: { entry: { - main: './src/index.tsx', + index: './src/index.tsx', }, }, plugins: [pluginReact()], diff --git a/packages/core/bin/rslib.js b/packages/core/bin/rslib.js index 25e99451c..79da1723e 100755 --- a/packages/core/bin/rslib.js +++ b/packages/core/bin/rslib.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -import { logger, prepareCli, runCli } from '../dist/main.js'; +import { logger, prepareCli, runCli } from '../dist/index.js'; async function main() { prepareCli(); diff --git a/packages/core/package.json b/packages/core/package.json index 5b1bf9564..c5ab99f7c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -16,11 +16,11 @@ "exports": { ".": { "types": "./dist-types/index.d.ts", - "default": "./dist/main.js" + "default": "./dist/index.js" }, "./package.json": "./package.json" }, - "main": "./dist/main.js", + "main": "./dist/index.js", "types": "./dist-types/index.d.ts", "bin": { "rslib": "./bin/rslib.js" diff --git a/packages/core/rslib.config.ts b/packages/core/rslib.config.ts index 7093ef657..900cf7304 100644 --- a/packages/core/rslib.config.ts +++ b/packages/core/rslib.config.ts @@ -18,7 +18,7 @@ export default defineConfig({ RSLIB_VERSION: JSON.stringify(require('./package.json').version), }, entry: { - main: './src/index.ts', + index: './src/index.ts', }, }, output: { diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 51fc3768e..9b5a736a4 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -339,8 +339,8 @@ const composeEntryConfig = async ( const entry = entries[key]; // Entries in bundleless mode could be: - // 1. A string of glob pattern: { entry: { main: 'src/*.ts' } } - // 2. An array of glob patterns: { entry: { main: ['src/*.ts', 'src/*.tsx'] } } + // 1. A string of glob pattern: { entry: { index: 'src/*.ts' } } + // 2. An array of glob patterns: { entry: { index: ['src/*.ts', 'src/*.tsx'] } } // Not supported for now: entry description object const entryFiles = Array.isArray(entry) ? entry diff --git a/packages/core/tests/config.test.ts b/packages/core/tests/config.test.ts index 290d310ea..9e9a3527f 100644 --- a/packages/core/tests/config.test.ts +++ b/packages/core/tests/config.test.ts @@ -14,7 +14,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { @@ -31,7 +31,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { @@ -48,7 +48,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.ts', + index: './foo/index.ts', }, }, _privateMeta: { @@ -65,7 +65,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { @@ -82,7 +82,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { @@ -99,7 +99,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { @@ -116,7 +116,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.ts', + index: './foo/index.ts', }, }, _privateMeta: { @@ -133,7 +133,7 @@ describe('Should load config file correctly', () => { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, _privateMeta: { diff --git a/packages/core/tests/fixtures/config/cjs/rslib.config.cjs b/packages/core/tests/fixtures/config/cjs/rslib.config.cjs index 0b9702ca7..c6670737d 100644 --- a/packages/core/tests/fixtures/config/cjs/rslib.config.cjs +++ b/packages/core/tests/fixtures/config/cjs/rslib.config.cjs @@ -4,7 +4,7 @@ module.exports = defineConfig((args) => ({ lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, })); diff --git a/packages/core/tests/fixtures/config/cjs/rslib.config.js b/packages/core/tests/fixtures/config/cjs/rslib.config.js index 2138d4cdd..5cf5bfbd0 100644 --- a/packages/core/tests/fixtures/config/cjs/rslib.config.js +++ b/packages/core/tests/fixtures/config/cjs/rslib.config.js @@ -2,7 +2,7 @@ module.exports = { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, }; diff --git a/packages/core/tests/fixtures/config/cjs/rslib.config.mjs b/packages/core/tests/fixtures/config/cjs/rslib.config.mjs index 3d824b6e9..82d7d0bdd 100644 --- a/packages/core/tests/fixtures/config/cjs/rslib.config.mjs +++ b/packages/core/tests/fixtures/config/cjs/rslib.config.mjs @@ -2,7 +2,7 @@ export default { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, }; diff --git a/packages/core/tests/fixtures/config/cjs/rslib.config.ts b/packages/core/tests/fixtures/config/cjs/rslib.config.ts index e23ab3976..5ad7b5589 100644 --- a/packages/core/tests/fixtures/config/cjs/rslib.config.ts +++ b/packages/core/tests/fixtures/config/cjs/rslib.config.ts @@ -2,7 +2,7 @@ export default { lib: [], source: { entry: { - main: './foo/index.ts', + index: './foo/index.ts', }, }, }; diff --git a/packages/core/tests/fixtures/config/esm/rslib.config.cjs b/packages/core/tests/fixtures/config/esm/rslib.config.cjs index 2138d4cdd..5cf5bfbd0 100644 --- a/packages/core/tests/fixtures/config/esm/rslib.config.cjs +++ b/packages/core/tests/fixtures/config/esm/rslib.config.cjs @@ -2,7 +2,7 @@ module.exports = { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, }; diff --git a/packages/core/tests/fixtures/config/esm/rslib.config.js b/packages/core/tests/fixtures/config/esm/rslib.config.js index 3d824b6e9..82d7d0bdd 100644 --- a/packages/core/tests/fixtures/config/esm/rslib.config.js +++ b/packages/core/tests/fixtures/config/esm/rslib.config.js @@ -2,7 +2,7 @@ export default { lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, }; diff --git a/packages/core/tests/fixtures/config/esm/rslib.config.mjs b/packages/core/tests/fixtures/config/esm/rslib.config.mjs index f94b552b4..604ca0d76 100644 --- a/packages/core/tests/fixtures/config/esm/rslib.config.mjs +++ b/packages/core/tests/fixtures/config/esm/rslib.config.mjs @@ -4,7 +4,7 @@ export default defineConfig((args) => ({ lib: [], source: { entry: { - main: './foo/index.js', + index: './foo/index.js', }, }, })); diff --git a/packages/core/tests/fixtures/config/esm/rslib.config.ts b/packages/core/tests/fixtures/config/esm/rslib.config.ts index e23ab3976..5ad7b5589 100644 --- a/packages/core/tests/fixtures/config/esm/rslib.config.ts +++ b/packages/core/tests/fixtures/config/esm/rslib.config.ts @@ -2,7 +2,7 @@ export default { lib: [], source: { entry: { - main: './foo/index.ts', + index: './foo/index.ts', }, }, }; diff --git a/packages/plugin-dts/rslib.config.ts b/packages/plugin-dts/rslib.config.ts index 16f270629..ce7d7e379 100644 --- a/packages/plugin-dts/rslib.config.ts +++ b/packages/plugin-dts/rslib.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ ], source: { entry: { - main: ['./src/**'], + index: ['./src/**'], }, }, output: { From b7c5297ba43d030f4c64346019e95fb7ea1c30a4 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 16 Aug 2024 15:55:42 +0800 Subject: [PATCH 2/3] chore: update --- examples/express-plugin/rslib.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/express-plugin/rslib.config.ts b/examples/express-plugin/rslib.config.ts index ca83666a3..1a23028fb 100644 --- a/examples/express-plugin/rslib.config.ts +++ b/examples/express-plugin/rslib.config.ts @@ -27,7 +27,7 @@ export default defineConfig({ }, }, ], - // TODO: We can remove this after https://github.com/web-infra-dev/rsbuild/pull/3225 being merged + // TODO: We can remove this after https://github.com/web-infra-dev/rsbuild/pull/3225 being released source: { entry: { index: './src/index.ts', From acc4fdb84ae0de7f05f6c591696fa1a9bb8f72bf Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 16 Aug 2024 15:56:42 +0800 Subject: [PATCH 3/3] chore: update --- examples/react-component/rslib.config.ts | 1 + packages/core/rslib.config.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/react-component/rslib.config.ts b/examples/react-component/rslib.config.ts index 54817c70f..bc7b1aaa6 100644 --- a/examples/react-component/rslib.config.ts +++ b/examples/react-component/rslib.config.ts @@ -28,6 +28,7 @@ export default defineConfig({ }, }, ], + // TODO: We can remove this after https://github.com/web-infra-dev/rsbuild/pull/3225 being released source: { entry: { index: './src/index.tsx', diff --git a/packages/core/rslib.config.ts b/packages/core/rslib.config.ts index 900cf7304..091bf465d 100644 --- a/packages/core/rslib.config.ts +++ b/packages/core/rslib.config.ts @@ -17,6 +17,7 @@ export default defineConfig({ define: { RSLIB_VERSION: JSON.stringify(require('./package.json').version), }, + // TODO: We can remove this after https://github.com/web-infra-dev/rsbuild/pull/3225 being released entry: { index: './src/index.ts', },