@unsetsoft/ryunix-presets 0.0.3 → 0.0.5

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.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/rspack/index.js +90 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunix-presets",
3
3
  "description": "Package with presets for different development environments.",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "author": "Neyunse",
6
6
  "type": "module",
7
7
  "repository": "https://github.com/UnSetSoft/Ryunixjs",
@@ -10,7 +10,8 @@
10
10
  "ryunixjs"
11
11
  ],
12
12
  "files": [
13
- "vite/"
13
+ "vite/",
14
+ "rspack/"
14
15
  ],
15
16
  "scripts": {},
16
17
  "dependencies": {},
@@ -0,0 +1,90 @@
1
+ import rspack from '@rspack/core'
2
+
3
+ const ryunixRspack = (isDev) => {
4
+ return {
5
+ mode: isDev ? 'development' : 'production',
6
+ context: __dirname,
7
+ entry: {
8
+ main: './main.ryx',
9
+ },
10
+ experiments: {
11
+ rspackFuture: {
12
+ disableTransformByDefault: true,
13
+ css: true,
14
+ },
15
+ },
16
+ output: {
17
+ publicPath: '/',
18
+ },
19
+ devServer: {
20
+ hot: isDev,
21
+ historyApiFallback: {
22
+ index: '/',
23
+ disableDotRule: true,
24
+ },
25
+ },
26
+ module: {
27
+ rules: [
28
+ {
29
+ test: /\.svg$/,
30
+ type: 'asset',
31
+ },
32
+ {
33
+ test: /\.css$/i,
34
+ use: [rspack.CssExtractRspackPlugin.loader, 'css-loader'],
35
+ type: 'javascript/auto',
36
+ },
37
+ {
38
+ test: /\.module\.css$/i,
39
+ type: 'css/module',
40
+ },
41
+ {
42
+ test: /\.(png|jpe?g|gif)$/i,
43
+ type: 'asset/resource',
44
+ },
45
+ {
46
+ test: /^BUILD_ID$/,
47
+ type: 'asset/source',
48
+ },
49
+ {
50
+ test: /\.jsx|.ryx$/,
51
+ exclude: [/[\\/]node_modules[\\/]/],
52
+ use: {
53
+ loader: 'builtin:swc-loader',
54
+ options: {
55
+ sourceMap: true,
56
+ jsc: {
57
+ parser: {
58
+ syntax: 'ecmascript',
59
+ jsx: true,
60
+ },
61
+ transform: {
62
+ react: {
63
+ pragma: 'Ryunix.createElement',
64
+ pragmaFrag: 'Ryunix.Fragment',
65
+ },
66
+ },
67
+ },
68
+ },
69
+ },
70
+ type: 'javascript/auto',
71
+ },
72
+ ],
73
+ },
74
+ resolve: {
75
+ extensions: ['.*', '.js', '.jsx', '.ryx'],
76
+ },
77
+ plugins: [
78
+ new rspack.CssExtractRspackPlugin({}),
79
+ new rspack.DefinePlugin({
80
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
81
+ }),
82
+ new rspack.ProgressPlugin({}),
83
+ new rspack.HtmlRspackPlugin({
84
+ template: './index.html',
85
+ }),
86
+ ].filter(Boolean),
87
+ }
88
+ }
89
+
90
+ export default ryunixRspack