Skip to content

Commit

Permalink
chore(plugin-preact): use Rslib to bundle (#3563)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Sep 27, 2024
1 parent 6e5abae commit b69fa51
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@changesets/cli": "^2.27.8",
"@modern-js/module-tools": "^2.60.1",
"@rsbuild/config": "workspace:*",
"@rslib/core": "0.0.7",
"@rslib/core": "0.0.8",
"@scripts/test-helper": "workspace:*",
"check-dependency-version-consistency": "^4.1.0",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-rsbuild/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from '@rslib/core';

export default defineConfig({
lib: [{ format: 'esm' }],
lib: [{ format: 'esm', syntax: 'es2021' }],
output: {
target: 'node',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/create-rsbuild/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
type Argv,
type ESLintTemplateName,
Expand All @@ -7,6 +8,8 @@ import {
select,
} from 'create-rstack';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const frameworkAlias: Record<string, string> = {
vue: 'vue3',
'solid-js': 'solid',
Expand Down
3 changes: 0 additions & 3 deletions packages/plugin-preact/modern.config.ts

This file was deleted.

11 changes: 5 additions & 6 deletions packages/plugin-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
"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",
"dist-types"
"dist"
],
"scripts": {
"build": "modern build",
"dev": "modern build --watch"
"build": "rslib build",
"dev": "rslib build --watch"
},
"devDependencies": {
"@rsbuild/core": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-preact/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { dualPackage } from '@rsbuild/config/rslib.config.ts';

export default dualPackage;
23 changes: 11 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scripts/config/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ export const dualPackage = defineConfig({
lib: [
{
format: 'esm',
syntax: 'es2021',
dts: { bundle: false },
},
{ format: 'cjs' },
{ format: 'cjs', syntax: 'es2021' },
],
output: {
target: 'node',
Expand Down

0 comments on commit b69fa51

Please sign in to comment.