@s-ui/bundler 9.39.0-typescript.100 → 9.39.0-typescript.102
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/package.json +2 -1
- package/shared/define.js +19 -4
- package/tsconfig.json +1 -1
- package/webpack.config.prod.js +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s-ui/bundler",
|
|
3
|
-
"version": "9.39.0-typescript.
|
|
3
|
+
"version": "9.39.0-typescript.102",
|
|
4
4
|
"description": "Config-free bundler for ES6 React apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sui-bundler": "./bin/sui-bundler.js"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@babel/core": "7.21.8",
|
|
25
25
|
"@s-ui/helpers": "1",
|
|
26
26
|
"@s-ui/sass-loader": "1",
|
|
27
|
+
"@s-ui/typescript-config": "typescript",
|
|
27
28
|
"@swc/core": "1.3.14",
|
|
28
29
|
"@swc/helpers": "0.4.12",
|
|
29
30
|
"@tsconfig/esm": "^1.0.3",
|
package/shared/define.js
CHANGED
|
@@ -6,9 +6,24 @@ if (process.platform === 'win32') {
|
|
|
6
6
|
process.env.PWD = process.cwd()
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const {MAGIC_STRINGS = '{}'} = process.env
|
|
10
|
+
|
|
11
|
+
let magic
|
|
12
|
+
try {
|
|
13
|
+
magic = JSON.parse(MAGIC_STRINGS)
|
|
14
|
+
} catch (err) {
|
|
15
|
+
magic = {}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = (vars = {}) => {
|
|
19
|
+
const definitions = {
|
|
11
20
|
__DEV__: false,
|
|
12
21
|
__BASE_DIR__: JSON.stringify(process.env.PWD),
|
|
13
|
-
...vars
|
|
14
|
-
|
|
22
|
+
...vars,
|
|
23
|
+
...Object.fromEntries(
|
|
24
|
+
Object.entries(magic).map(([key, value]) => [key, JSON.stringify(value)])
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new webpack.DefinePlugin(definitions)
|
|
29
|
+
}
|
package/tsconfig.json
CHANGED
package/webpack.config.prod.js
CHANGED
|
@@ -53,7 +53,17 @@ const webpackConfig = {
|
|
|
53
53
|
target,
|
|
54
54
|
context: path.resolve(CWD, 'src'),
|
|
55
55
|
resolve: {
|
|
56
|
-
alias: {
|
|
56
|
+
alias: {
|
|
57
|
+
...aliasFromConfig,
|
|
58
|
+
'react/jsx-dev-runtime.js': path.resolve(
|
|
59
|
+
CWD,
|
|
60
|
+
'node_modules/react/jsx-dev-runtime.js'
|
|
61
|
+
),
|
|
62
|
+
'react/jsx-runtime.js': path.resolve(
|
|
63
|
+
CWD,
|
|
64
|
+
'node_modules/react/jsx-runtime.js'
|
|
65
|
+
)
|
|
66
|
+
},
|
|
57
67
|
extensions: ['.js', '.json', '.ts', '.tsx'],
|
|
58
68
|
modules: ['node_modules', path.resolve(CWD)],
|
|
59
69
|
fallback: {
|