@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "9.39.0-typescript.100",
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
- module.exports = (vars = {}) =>
10
- new webpack.DefinePlugin({
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
@@ -1,3 +1,3 @@
1
1
  {
2
- "extends": ["@tsconfig/esm/tsconfig.json", "@tsconfig/vite-react/tsconfig.json"],
2
+ "extends": ["@s-ui/typescript-config/tsconfig.json"]
3
3
  }
@@ -53,7 +53,17 @@ const webpackConfig = {
53
53
  target,
54
54
  context: path.resolve(CWD, 'src'),
55
55
  resolve: {
56
- alias: {...aliasFromConfig},
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: {