create-rspack 0.7.6-canary-f272bd8-20240625122346 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +5 -1
- package/template-react/{rspack.config.js → rspack.config.mjs} +15 -9
- package/template-react-ts/package.json +3 -1
- package/template-react-ts/{rspack.config.js → rspack.config.ts} +12 -9
- package/template-react-ts/tsconfig.json +15 -11
- package/template-vanilla/rspack.config.mjs +9 -0
- package/template-vue/package.json +3 -8
- package/template-vue/{rspack.config.js → rspack.config.mjs} +19 -10
- package/template-vue/src/main.js +0 -2
- package/template-vue-ts/package.json +7 -12
- package/template-vue-ts/rspack.config.ts +13 -18
- package/template-vue-ts/src/main.ts +0 -2
- package/template-vue-ts/tsconfig.json +13 -10
- package/template-vanilla/rspack.config.js +0 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<picture>
|
|
2
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://
|
|
3
|
-
<img alt="Rspack Banner" src="https://
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://assets.rspack.dev/rspack/rspack-banner-plain-dark.png">
|
|
3
|
+
<img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner-plain-light.png">
|
|
4
4
|
</picture>
|
|
5
5
|
|
|
6
6
|
# create-rspack
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rspack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-rspack": "index.js"
|
|
8
8
|
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public",
|
|
11
|
+
"provenance": true
|
|
12
|
+
},
|
|
9
13
|
"homepage": "https://rspack.dev",
|
|
10
14
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
11
15
|
"repository": {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { dirname } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { defineConfig } from "@rspack/cli";
|
|
4
|
+
import { rspack } from "@rspack/core";
|
|
5
|
+
import RefreshPlugin from "@rspack/plugin-react-refresh";
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
3
8
|
const isDev = process.env.NODE_ENV === "development";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
module.exports = {
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
8
11
|
context: __dirname,
|
|
9
12
|
entry: {
|
|
10
13
|
main: "./src/main.jsx"
|
|
@@ -59,6 +62,9 @@ module.exports = {
|
|
|
59
62
|
new rspack.HtmlRspackPlugin({
|
|
60
63
|
template: "./index.html"
|
|
61
64
|
}),
|
|
62
|
-
isDev ? new
|
|
63
|
-
].filter(Boolean)
|
|
64
|
-
|
|
65
|
+
isDev ? new RefreshPlugin() : null
|
|
66
|
+
].filter(Boolean),
|
|
67
|
+
experiments: {
|
|
68
|
+
css: true
|
|
69
|
+
}
|
|
70
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { defineConfig } from "@rspack/cli";
|
|
2
|
+
import { rspack } from "@rspack/core";
|
|
3
|
+
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
|
|
4
|
+
|
|
3
5
|
const isDev = process.env.NODE_ENV === "development";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
module.exports = {
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
8
|
context: __dirname,
|
|
9
9
|
entry: {
|
|
10
10
|
main: "./src/main.tsx"
|
|
@@ -59,6 +59,9 @@ module.exports = {
|
|
|
59
59
|
new rspack.HtmlRspackPlugin({
|
|
60
60
|
template: "./index.html"
|
|
61
61
|
}),
|
|
62
|
-
isDev ? new
|
|
63
|
-
].filter(Boolean)
|
|
64
|
-
|
|
62
|
+
isDev ? new RefreshPlugin() : null
|
|
63
|
+
].filter(Boolean),
|
|
64
|
+
experiments: {
|
|
65
|
+
css: true
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"lib": ["DOM", "
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": ["DOM", "ES2020"],
|
|
5
5
|
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"allowImportingTsExtensions": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"noEmit": true,
|
|
11
6
|
"jsx": "react-jsx",
|
|
12
7
|
"strict": true,
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"useDefineForClassFields": true,
|
|
14
|
+
"allowImportingTsExtensions": true
|
|
16
15
|
},
|
|
17
|
-
"include": ["src"]
|
|
16
|
+
"include": ["src"],
|
|
17
|
+
"ts-node": {
|
|
18
|
+
"compilerOptions": {
|
|
19
|
+
"module": "CommonJS"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
18
22
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspack-vue-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
4
|
"private": true,
|
|
6
|
-
"main": "index.js",
|
|
7
5
|
"scripts": {
|
|
8
|
-
"dev": "rspack serve",
|
|
9
|
-
"build": "rspack build"
|
|
6
|
+
"dev": "NODE_ENV=development rspack serve",
|
|
7
|
+
"build": "NODE_ENV=production rspack build"
|
|
10
8
|
},
|
|
11
9
|
"dependencies": {
|
|
12
10
|
"vue": "3.2.45"
|
|
@@ -15,8 +13,5 @@
|
|
|
15
13
|
"@rspack/cli": "workspace:*",
|
|
16
14
|
"@rspack/core": "workspace:*",
|
|
17
15
|
"vue-loader": "^17.2.2"
|
|
18
|
-
}
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC"
|
|
16
|
+
}
|
|
22
17
|
}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { dirname } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { defineConfig } from "@rspack/cli";
|
|
4
|
+
import { rspack } from "@rspack/core";
|
|
5
|
+
import { VueLoaderPlugin } from "vue-loader";
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
export default defineConfig({
|
|
6
10
|
context: __dirname,
|
|
7
11
|
entry: {
|
|
8
12
|
main: "./src/main.js"
|
|
9
13
|
},
|
|
10
14
|
resolve: {
|
|
11
|
-
extensions: ["...", ".ts"]
|
|
15
|
+
extensions: ["...", ".ts", ".vue"]
|
|
12
16
|
},
|
|
13
17
|
plugins: [
|
|
14
18
|
new VueLoaderPlugin(),
|
|
15
19
|
new rspack.HtmlRspackPlugin({
|
|
16
20
|
template: "./index.html"
|
|
21
|
+
}),
|
|
22
|
+
new rspack.DefinePlugin({
|
|
23
|
+
__VUE_OPTIONS_API__: true,
|
|
24
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
17
25
|
})
|
|
18
26
|
],
|
|
19
27
|
module: {
|
|
@@ -33,8 +41,7 @@ const config = {
|
|
|
33
41
|
options: {
|
|
34
42
|
jsc: {
|
|
35
43
|
parser: {
|
|
36
|
-
syntax: "typescript"
|
|
37
|
-
tsx: false
|
|
44
|
+
syntax: "typescript"
|
|
38
45
|
}
|
|
39
46
|
},
|
|
40
47
|
env: {
|
|
@@ -54,6 +61,8 @@ const config = {
|
|
|
54
61
|
type: "asset/resource"
|
|
55
62
|
}
|
|
56
63
|
]
|
|
64
|
+
},
|
|
65
|
+
experiments: {
|
|
66
|
+
css: true
|
|
57
67
|
}
|
|
58
|
-
};
|
|
59
|
-
module.exports = config;
|
|
68
|
+
});
|
package/template-vue/src/main.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "rspack-vue-starter",
|
|
2
|
+
"name": "rspack-vue-ts-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
4
|
"private": true,
|
|
6
|
-
"main": "index.js",
|
|
7
5
|
"scripts": {
|
|
8
|
-
"dev": "rspack serve",
|
|
9
|
-
"build": "rspack build"
|
|
6
|
+
"dev": "NODE_ENV=development rspack serve",
|
|
7
|
+
"build": "NODE_ENV=production rspack build"
|
|
10
8
|
},
|
|
11
9
|
"dependencies": {
|
|
12
10
|
"vue": "3.4.21"
|
|
@@ -14,11 +12,8 @@
|
|
|
14
12
|
"devDependencies": {
|
|
15
13
|
"@rspack/cli": "workspace:*",
|
|
16
14
|
"@rspack/core": "workspace:*",
|
|
17
|
-
"vue-loader": "^17.2.2",
|
|
18
15
|
"ts-node": "^10.9.2",
|
|
19
|
-
"typescript": "^5.3.3"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"license": "ISC"
|
|
24
|
-
}
|
|
16
|
+
"typescript": "^5.3.3",
|
|
17
|
+
"vue-loader": "^17.2.2"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DefinePlugin,
|
|
4
|
-
HtmlRspackPlugin,
|
|
5
|
-
RspackPluginFunction
|
|
6
|
-
} from "@rspack/core";
|
|
1
|
+
import { defineConfig } from "@rspack/cli";
|
|
2
|
+
import { type RspackPluginFunction, rspack } from "@rspack/core";
|
|
7
3
|
import { VueLoaderPlugin } from "vue-loader";
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const config: Configuration = {
|
|
5
|
+
export default defineConfig({
|
|
12
6
|
context: __dirname,
|
|
13
7
|
entry: {
|
|
14
8
|
main: "./src/main.ts"
|
|
15
9
|
},
|
|
16
10
|
resolve: {
|
|
17
|
-
extensions: ["...", ".ts"]
|
|
11
|
+
extensions: ["...", ".ts", ".vue"]
|
|
18
12
|
},
|
|
19
13
|
plugins: [
|
|
20
14
|
new VueLoaderPlugin() as RspackPluginFunction,
|
|
21
|
-
new HtmlRspackPlugin({
|
|
15
|
+
new rspack.HtmlRspackPlugin({
|
|
22
16
|
template: "./index.html"
|
|
23
17
|
}),
|
|
24
|
-
new DefinePlugin({
|
|
25
|
-
|
|
18
|
+
new rspack.DefinePlugin({
|
|
19
|
+
__VUE_OPTIONS_API__: true,
|
|
20
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
26
21
|
})
|
|
27
22
|
],
|
|
28
23
|
module: {
|
|
@@ -43,8 +38,7 @@ const config: Configuration = {
|
|
|
43
38
|
sourceMap: true,
|
|
44
39
|
jsc: {
|
|
45
40
|
parser: {
|
|
46
|
-
syntax: "typescript"
|
|
47
|
-
tsx: false
|
|
41
|
+
syntax: "typescript"
|
|
48
42
|
}
|
|
49
43
|
},
|
|
50
44
|
env: {
|
|
@@ -64,7 +58,8 @@ const config: Configuration = {
|
|
|
64
58
|
type: "asset/resource"
|
|
65
59
|
}
|
|
66
60
|
]
|
|
61
|
+
},
|
|
62
|
+
experiments: {
|
|
63
|
+
css: true
|
|
67
64
|
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default config;
|
|
65
|
+
});
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
-
"lib": [
|
|
5
|
-
|
|
6
|
-
"ES2020"
|
|
7
|
-
],
|
|
8
|
-
"module": "CommonJS",
|
|
4
|
+
"lib": ["DOM", "ES2020"],
|
|
5
|
+
"module": "ESNext",
|
|
9
6
|
"jsx": "preserve",
|
|
10
7
|
"jsxImportSource": "vue",
|
|
11
8
|
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
12
10
|
"skipLibCheck": true,
|
|
13
11
|
"isolatedModules": true,
|
|
14
12
|
"resolveJsonModule": true,
|
|
15
|
-
"
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"useDefineForClassFields": true,
|
|
15
|
+
"allowImportingTsExtensions": true
|
|
16
16
|
},
|
|
17
|
-
"include": [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"include": ["src"],
|
|
18
|
+
"ts-node": {
|
|
19
|
+
"compilerOptions": {
|
|
20
|
+
"module": "CommonJS"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|