From d807a6e3ab39dba6a122e5094b649a4adbd4b565 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 18 Sep 2024 06:39:22 +0200 Subject: [PATCH] chore(plugin-less): use Rslib to bundle (#3502) --- packages/plugin-less/modern.config.ts | 3 --- packages/plugin-less/package.json | 12 ++++++------ packages/plugin-less/rslib.config.ts | 14 ++++++++++++++ pnpm-lock.yaml | 3 +++ 4 files changed, 23 insertions(+), 9 deletions(-) delete mode 100644 packages/plugin-less/modern.config.ts create mode 100644 packages/plugin-less/rslib.config.ts diff --git a/packages/plugin-less/modern.config.ts b/packages/plugin-less/modern.config.ts deleted file mode 100644 index aa96b2c676..0000000000 --- a/packages/plugin-less/modern.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; - -export default configForSeparateTypesPackage; diff --git a/packages/plugin-less/package.json b/packages/plugin-less/package.json index a97deecc29..c46c77403c 100644 --- a/packages/plugin-less/package.json +++ b/packages/plugin-less/package.json @@ -12,21 +12,20 @@ "type": "module", "exports": { ".": { - "types": "./dist-types/index.d.ts", + "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" } }, "main": "./dist/index.cjs", - "types": "./dist-types/index.d.ts", + "types": "./dist/index.d.ts", "files": [ "dist", - "compiled", - "dist-types" + "compiled" ], "scripts": { - "build": "modern build", - "dev": "modern build --watch", + "build": "rslib build", + "dev": "rslib build --watch", "prebundle": "prebundle" }, "dependencies": { @@ -35,6 +34,7 @@ }, "devDependencies": { "@rsbuild/core": "workspace:*", + "@rslib/core": "0.0.6", "@scripts/test-helper": "workspace:*", "@types/less": "^3.0.6", "less": "^4.2.0", diff --git a/packages/plugin-less/rslib.config.ts b/packages/plugin-less/rslib.config.ts new file mode 100644 index 0000000000..71da3740f1 --- /dev/null +++ b/packages/plugin-less/rslib.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from '@rslib/core'; + +export default defineConfig({ + lib: [ + { + format: 'esm', + dts: { bundle: false }, + }, + { format: 'cjs' }, + ], + output: { + target: 'node', + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc61b29b2a..18f40b4c2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -838,6 +838,9 @@ importers: '@rsbuild/core': specifier: workspace:* version: link:../core + '@rslib/core': + specifier: 0.0.6 + version: 0.0.6(typescript@5.5.2) '@scripts/test-helper': specifier: workspace:* version: link:../../scripts/test-helper