@shuvi/toolpack 1.0.56 → 1.0.58
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.
|
@@ -201,6 +201,10 @@ function createBrowserWebpackChain(options) {
|
|
|
201
201
|
]);
|
|
202
202
|
chain.plugin('define').tap(([options]) => [
|
|
203
203
|
Object.assign(Object.assign({}, options), { __BROWSER__: true,
|
|
204
|
+
/**
|
|
205
|
+
* swc.optimizer can't handle `typeof window` correctly for dependencies
|
|
206
|
+
*/
|
|
207
|
+
'typeof window': JSON.stringify('object'),
|
|
204
208
|
// prevent errof of destructing process.env
|
|
205
209
|
'process.env': JSON.stringify('{}') })
|
|
206
210
|
]);
|
|
@@ -36,7 +36,11 @@ function createNodeWebpackChain(options) {
|
|
|
36
36
|
.use('shuvi-swc-loader')
|
|
37
37
|
.tap(options => (Object.assign(Object.assign({}, options), { isServer: true })));
|
|
38
38
|
chain.plugin('define').tap(([options]) => [
|
|
39
|
-
Object.assign(Object.assign({}, options), { __BROWSER__: false
|
|
39
|
+
Object.assign(Object.assign({}, options), { __BROWSER__: false,
|
|
40
|
+
/**
|
|
41
|
+
* swc.optimizer can't handle `typeof window` correctly for dependencies
|
|
42
|
+
*/
|
|
43
|
+
'typeof window': JSON.stringify('undefined') })
|
|
40
44
|
]);
|
|
41
45
|
return (0, style_1.withStyle)(chain, {
|
|
42
46
|
ssr: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/toolpack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"node": ">= 16.0.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@shuvi/compiler": "1.0.
|
|
23
|
+
"@shuvi/compiler": "1.0.58",
|
|
24
24
|
"@babel/core": "7.12.10",
|
|
25
25
|
"@babel/plugin-proposal-class-properties": "7.12.1",
|
|
26
26
|
"@babel/plugin-proposal-nullish-coalescing-operator": "7.10.1",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@babel/preset-typescript": "7.12.7",
|
|
36
36
|
"@babel/runtime": "7.12.5",
|
|
37
37
|
"lightningcss": "1.19.0",
|
|
38
|
-
"@shuvi/shared": "1.0.
|
|
39
|
-
"@shuvi/utils": "1.0.
|
|
38
|
+
"@shuvi/shared": "1.0.58",
|
|
39
|
+
"@shuvi/utils": "1.0.58",
|
|
40
40
|
"babel-loader": "8.2.2",
|
|
41
41
|
"babel-plugin-syntax-jsx": "6.18.0",
|
|
42
42
|
"babel-plugin-transform-define": "2.0.0",
|