Skip to content

Commit b782d92

Browse files
authored
chore: add Rspack example to playground (#27)
1 parent b5261fb commit b782d92

File tree

5 files changed

+2577
-210
lines changed

5 files changed

+2577
-210
lines changed

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"main": "./dist/index.cjs",
1515
"module": "./dist/index.js",
1616
"types": "./dist/index.d.ts",
17-
"files": ["dist"],
17+
"files": [
18+
"dist"
19+
],
1820
"scripts": {
1921
"build": "rslib build",
2022
"dev": "rslib build --watch",
@@ -44,14 +46,16 @@
4446
"@playwright/test": "^1.50.1",
4547
"@rsbuild/core": "^1.2.3",
4648
"@rslib/core": "^0.4.0",
49+
"@rspack/cli": "^1.2.3",
50+
"@rspack/core": "^1.2.3",
4751
"@types/node": "^22.13.0",
4852
"nano-staged": "^0.8.0",
4953
"playwright": "^1.50.1",
54+
"rslog": "^1.2.3",
5055
"simple-git-hooks": "^2.11.1",
5156
"strip-ansi": "^7.1.0",
5257
"typescript": "^5.7.3",
53-
"upath": "^2.0.1",
54-
"rslog": "^1.2.3"
58+
"upath": "^2.0.1"
5559
},
5660
"peerDependencies": {
5761
"@rsbuild/core": "1.x"

playground/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"version": "0.0.0",
55
"scripts": {
66
"dev": "npx rsbuild dev",
7-
"build": "npx rsbuild build"
7+
"dev:rspack": "NODE_ENV=development npx rspack dev",
8+
"build": "npx rsbuild build",
9+
"build:rspack": "NODE_ENV=production npx rspack build"
810
}
911
}

playground/rspack.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from '@rspack/cli';
2+
import { CheckSyntaxRspackPlugin } from '../dist/index.js';
3+
4+
export default defineConfig({
5+
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
6+
devtool: 'source-map',
7+
plugins: [
8+
new CheckSyntaxRspackPlugin({
9+
ecmaVersion: 5,
10+
}),
11+
],
12+
});

0 commit comments

Comments
 (0)