@shuvi/toolpack 1.0.57 → 1.0.59

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
  ]);
@@ -19,9 +19,6 @@ function createNodeWebpackChain(options) {
19
19
  '.json',
20
20
  '.wasm'
21
21
  ]);
22
- // fix: Can't reexport the named export 'BREAK' from non EcmaScript module
23
- // related issue: https://github.com/graphql/graphql-js/issues/1272
24
- chain.resolve.mainFields.clear().add('main').add('module');
25
22
  chain.output.libraryTarget('commonjs2');
26
23
  chain.optimization.minimize(false);
27
24
  // use default splitChunks config
@@ -36,7 +33,11 @@ function createNodeWebpackChain(options) {
36
33
  .use('shuvi-swc-loader')
37
34
  .tap(options => (Object.assign(Object.assign({}, options), { isServer: true })));
38
35
  chain.plugin('define').tap(([options]) => [
39
- Object.assign(Object.assign({}, options), { __BROWSER__: false })
36
+ Object.assign(Object.assign({}, options), { __BROWSER__: false,
37
+ /**
38
+ * swc.optimizer can't handle `typeof window` correctly for dependencies
39
+ */
40
+ 'typeof window': JSON.stringify('undefined') })
40
41
  ]);
41
42
  return (0, style_1.withStyle)(chain, {
42
43
  ssr: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/toolpack",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
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.57",
23
+ "@shuvi/compiler": "1.0.59",
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.57",
39
- "@shuvi/utils": "1.0.57",
38
+ "@shuvi/shared": "1.0.59",
39
+ "@shuvi/utils": "1.0.59",
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",