Skip to content

Commit 95c859b

Browse files
committed
feat: prepared for rspack 2 & rsbuild 2
1 parent 30a3ba7 commit 95c859b

32 files changed

Lines changed: 741 additions & 58 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "rspack-plugin-solid-svg-rsbuild-example",
2+
"name": "rspack-plugin-solid-svg-rsbuild-v1-example",
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { defineConfig } from '@rsbuild/core';
2+
import { pluginBabel } from '@rsbuild/plugin-babel';
3+
import { pluginSolid } from '@rsbuild/plugin-solid';
4+
import { rsbuildPluginSolidSvg } from 'rspack-plugin-solid-svg/rsbuild';
5+
6+
// import { rsbuildPluginSolidSvg } from 'rspack-plugin-solid-svg'; // another way
7+
8+
// Docs: https://rsbuild.rs/config/
9+
export default defineConfig({
10+
source: {
11+
entry: {
12+
index: './src/App.tsx',
13+
},
14+
},
15+
html: {
16+
title: 'Solid SVG Plugin Test',
17+
},
18+
server: {
19+
open: false,
20+
port: 3003,
21+
},
22+
plugins: [
23+
pluginBabel({
24+
include: /\.(?:jsx|tsx)$/,
25+
babelLoaderOptions: {
26+
presets: ['solid'],
27+
},
28+
}),
29+
pluginSolid(),
30+
rsbuildPluginSolidSvg(),
31+
],
32+
});

examples/rsbuild-v2/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "rspack-plugin-solid-svg-rsbuild-v2-example",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": ">=20"
8+
},
9+
"scripts": {
10+
"dev": "rsbuild dev",
11+
"build": "tsc && rsbuild build"
12+
},
13+
"dependencies": {
14+
"solid-js": "^1.9.11"
15+
},
16+
"devDependencies": {
17+
"@rsbuild/core": "^2.0.7",
18+
"@rsbuild/plugin-babel": "^1.1.2",
19+
"@rsbuild/plugin-solid": "^1.1.1",
20+
"rspack-plugin-solid-svg": "workspace:*",
21+
"typescript": "^5.9.3"
22+
}
23+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from '@rsbuild/core';
22
import { pluginBabel } from '@rsbuild/plugin-babel';
33
import { pluginSolid } from '@rsbuild/plugin-solid';
44
import { rsbuildPluginSolidSvg } from 'rspack-plugin-solid-svg/rsbuild';
5+
56
// import { rsbuildPluginSolidSvg } from 'rspack-plugin-solid-svg'; // another way
67

78
// Docs: https://rsbuild.rs/config/
@@ -11,9 +12,12 @@ export default defineConfig({
1112
index: './src/App.tsx',
1213
},
1314
},
15+
html: {
16+
title: 'Solid SVG Plugin Test',
17+
},
1418
server: {
1519
open: false,
16-
port: 3003,
20+
port: 3005,
1721
},
1822
plugins: [
1923
pluginBabel({

0 commit comments

Comments
 (0)