@shuvi/toolpack 0.0.1-rc.9 → 1.0.0-rc.2

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 (159) hide show
  1. package/lib/babel/plugins/auto-css-modules.js +1 -1
  2. package/lib/babel/plugins/{loadable-plugin.d.ts → dynamic-plugin.d.ts} +1 -1
  3. package/lib/babel/plugins/{loadable-plugin.js → dynamic-plugin.js} +9 -9
  4. package/lib/babel/plugins/optimize-hook-destructuring.d.ts +1 -1
  5. package/lib/babel/plugins/optimize-hook-destructuring.js +4 -4
  6. package/lib/babel/preset.js +25 -5
  7. package/lib/constants.d.ts +1 -0
  8. package/lib/constants.js +5 -1
  9. package/lib/swc/tests/fixture/auto-css-module/no-flag/input.d.ts +1 -0
  10. package/lib/swc/tests/fixture/auto-css-module/no-flag/input.js +4 -0
  11. package/lib/swc/tests/fixture/auto-css-module/no-flag/output.d.ts +1 -0
  12. package/lib/swc/tests/fixture/auto-css-module/no-flag/output.js +4 -0
  13. package/lib/swc/tests/fixture/auto-css-module/with-flag/input.d.ts +1 -0
  14. package/lib/swc/tests/fixture/auto-css-module/with-flag/input.js +2 -0
  15. package/lib/swc/tests/fixture/auto-css-module/with-flag/output.d.ts +1 -0
  16. package/lib/swc/tests/fixture/auto-css-module/with-flag/output.js +2 -0
  17. package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/input.d.ts +1 -0
  18. package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/input.js +5 -0
  19. package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/output.d.ts +1 -0
  20. package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/output.js +11 -0
  21. package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/input.d.ts +1 -0
  22. package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/input.js +9 -0
  23. package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/output.d.ts +1 -0
  24. package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/output.js +12 -0
  25. package/lib/swc/tests/fixture/shuvi-dynamic/no-options/input.d.ts +1 -0
  26. package/lib/swc/tests/fixture/shuvi-dynamic/no-options/input.js +4 -0
  27. package/lib/swc/tests/fixture/shuvi-dynamic/no-options/output.d.ts +1 -0
  28. package/lib/swc/tests/fixture/shuvi-dynamic/no-options/output.js +7 -0
  29. package/lib/swc/tests/fixture/shuvi-dynamic/with-options/input.d.ts +1 -0
  30. package/lib/swc/tests/fixture/shuvi-dynamic/with-options/input.js +4 -0
  31. package/lib/swc/tests/fixture/shuvi-dynamic/with-options/output.d.ts +1 -0
  32. package/lib/swc/tests/fixture/shuvi-dynamic/with-options/output.js +8 -0
  33. package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/input.d.ts +1 -0
  34. package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/input.js +7 -0
  35. package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/output.d.ts +1 -0
  36. package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/output.js +9 -0
  37. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/input.d.ts +1 -0
  38. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/input.js +5 -0
  39. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/output.d.ts +1 -0
  40. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/output.js +11 -0
  41. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/input.d.ts +1 -0
  42. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/input.js +9 -0
  43. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/output.d.ts +1 -0
  44. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/output.js +12 -0
  45. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/input.d.ts +1 -0
  46. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/input.js +4 -0
  47. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/output.d.ts +1 -0
  48. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/output.js +7 -0
  49. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/input.d.ts +1 -0
  50. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/input.js +4 -0
  51. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/output.d.ts +1 -0
  52. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/output.js +8 -0
  53. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/input.d.ts +1 -0
  54. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/input.js +7 -0
  55. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/output.d.ts +1 -0
  56. package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/output.js +9 -0
  57. package/lib/swc/tests/full/auto-cjs/1/input.d.ts +1 -0
  58. package/lib/swc/tests/full/auto-cjs/1/input.js +8 -0
  59. package/lib/swc/tests/full/auto-cjs/1/output.d.ts +1 -0
  60. package/lib/swc/tests/full/auto-cjs/1/output.js +8 -0
  61. package/lib/utils/build-loaders.d.ts +2 -0
  62. package/lib/utils/build-loaders.js +131 -0
  63. package/lib/utils/bundle-require.d.ts +33 -0
  64. package/lib/utils/bundle-require.js +143 -0
  65. package/lib/utils/forkTsCheckerWebpackPlugin.js +2 -1
  66. package/lib/utils/formatWebpackMessages.d.ts +1 -1
  67. package/lib/utils/formatWebpackMessages.js +2 -1
  68. package/lib/utils/getSWCOptions.d.ts +91 -0
  69. package/lib/utils/getSWCOptions.js +66 -0
  70. package/lib/utils/hotDevClient/eventsource.js +1 -0
  71. package/lib/utils/hotDevClient/index.js +117 -33
  72. package/lib/utils/hotDevClient/websocket.d.ts +13 -0
  73. package/lib/utils/hotDevClient/websocket.js +59 -0
  74. package/lib/utils/load-sources.d.ts +3 -0
  75. package/lib/utils/load-sources.js +96 -0
  76. package/lib/webpack/config/base.d.ts +15 -4
  77. package/lib/webpack/config/base.js +108 -85
  78. package/lib/webpack/config/browser.d.ts +3 -4
  79. package/lib/webpack/config/browser.js +87 -34
  80. package/lib/webpack/config/index.js +18 -7
  81. package/lib/webpack/config/node.d.ts +3 -4
  82. package/lib/webpack/config/node.js +19 -26
  83. package/lib/webpack/config/parts/external.d.ts +3 -2
  84. package/lib/webpack/config/parts/external.js +16 -10
  85. package/lib/webpack/config/parts/helpers.d.ts +2 -1
  86. package/lib/webpack/config/parts/helpers.js +7 -1
  87. package/lib/webpack/config/parts/resolve.js +1 -0
  88. package/lib/webpack/config/parts/style.d.ts +5 -2
  89. package/lib/webpack/config/parts/style.js +125 -60
  90. package/lib/webpack/dynamic-dll/bundler/index.d.ts +22 -0
  91. package/lib/webpack/dynamic-dll/bundler/index.js +211 -0
  92. package/lib/webpack/dynamic-dll/bundler/webpack-config.d.ts +16 -0
  93. package/lib/webpack/dynamic-dll/bundler/webpack-config.js +116 -0
  94. package/lib/webpack/dynamic-dll/constants.d.ts +6 -0
  95. package/lib/webpack/dynamic-dll/constants.js +9 -0
  96. package/lib/webpack/dynamic-dll/dep/getCJSExports.d.ts +3 -0
  97. package/lib/webpack/dynamic-dll/dep/getCJSExports.js +58 -0
  98. package/lib/webpack/dynamic-dll/dep/getExposeFromContent.d.ts +1 -0
  99. package/lib/webpack/dynamic-dll/dep/getExposeFromContent.js +80 -0
  100. package/lib/webpack/dynamic-dll/dep/getModuleExports.d.ts +7 -0
  101. package/lib/webpack/dynamic-dll/dep/getModuleExports.js +46 -0
  102. package/lib/webpack/dynamic-dll/dep/index.d.ts +13 -0
  103. package/lib/webpack/dynamic-dll/dep/index.js +43 -0
  104. package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.d.ts +1 -0
  105. package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.js +15 -0
  106. package/lib/webpack/dynamic-dll/index.d.ts +35 -0
  107. package/lib/webpack/dynamic-dll/index.js +198 -0
  108. package/lib/webpack/dynamic-dll/metadata.d.ts +13 -0
  109. package/lib/webpack/dynamic-dll/metadata.js +62 -0
  110. package/lib/webpack/dynamic-dll/moduleCollector.d.ts +28 -0
  111. package/lib/webpack/dynamic-dll/moduleCollector.js +64 -0
  112. package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.d.ts +24 -0
  113. package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.js +70 -0
  114. package/lib/webpack/dynamic-dll/utils.d.ts +6 -0
  115. package/lib/webpack/dynamic-dll/utils.js +29 -0
  116. package/lib/webpack/index.d.ts +15 -0
  117. package/lib/webpack/index.js +110 -0
  118. package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.d.ts +4 -0
  119. package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.js +39 -0
  120. package/lib/webpack/loaders/parcel-css-loader/index.d.ts +4 -0
  121. package/lib/webpack/loaders/parcel-css-loader/index.js +369 -0
  122. package/lib/webpack/loaders/parcel-css-loader/runtime/api.d.ts +2 -0
  123. package/lib/webpack/loaders/parcel-css-loader/runtime/api.js +85 -0
  124. package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.d.ts +2 -0
  125. package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.js +23 -0
  126. package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.d.ts +2 -0
  127. package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.js +2 -0
  128. package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.d.ts +2 -0
  129. package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.js +16 -0
  130. package/lib/webpack/loaders/parcel-css-loader/utils.d.ts +28 -0
  131. package/lib/webpack/loaders/parcel-css-loader/utils.js +869 -0
  132. package/lib/webpack/loaders/route-component-loader.js +25 -5
  133. package/lib/webpack/loaders/shuvi-swc-loader.d.ts +2 -0
  134. package/lib/webpack/loaders/shuvi-swc-loader.js +96 -0
  135. package/lib/webpack/plugins/build-manifest-plugin.js +44 -23
  136. package/lib/webpack/plugins/dynamic-public-path-plugin.d.ts +9 -0
  137. package/lib/webpack/plugins/dynamic-public-path-plugin.js +50 -0
  138. package/lib/webpack/plugins/fix-watching-plugin.d.ts +4 -0
  139. package/lib/webpack/plugins/fix-watching-plugin.js +23 -0
  140. package/lib/webpack/plugins/jsconfig-paths-plugin.d.ts +44 -0
  141. package/lib/webpack/plugins/jsconfig-paths-plugin.js +228 -0
  142. package/lib/webpack/plugins/module-replace-plugin/index.js +5 -1
  143. package/lib/webpack/plugins/module-replace-plugin/plugin.d.ts +6 -6
  144. package/lib/webpack/plugins/module-replace-plugin/plugin.js +47 -32
  145. package/lib/webpack/plugins/module-replace-plugin/stub-loader.js +47 -7
  146. package/lib/webpack/plugins/require-cache-hot-reloader-plugin.js +9 -8
  147. package/lib/webpack/plugins/support-ts-extension-resolver-plugin.d.ts +4 -0
  148. package/lib/webpack/plugins/support-ts-extension-resolver-plugin.js +23 -0
  149. package/lib/webpack/types.d.ts +40 -0
  150. package/lib/webpack/types.js +2 -0
  151. package/package.json +77 -39
  152. package/lib/utils/emptyComponent.d.ts +0 -1
  153. package/lib/utils/emptyComponent.js +0 -7
  154. package/lib/utils/errorOverlayMiddleware.d.ts +0 -1
  155. package/lib/utils/errorOverlayMiddleware.js +0 -21
  156. package/lib/utils/verifyTypeScriptSetup.d.ts +0 -5
  157. package/lib/utils/verifyTypeScriptSetup.js +0 -229
  158. package/lib/webpack/loaders/export-global-loader.d.ts +0 -7
  159. package/lib/webpack/loaders/export-global-loader.js +0 -26
@@ -9,7 +9,7 @@ function default_1() {
9
9
  visitor: {
10
10
  ImportDeclaration(path, { opts }) {
11
11
  const { specifiers, source, source: { value }, } = path.node;
12
- if (specifiers.length && CSS_EXTNAMES.includes(path_1.extname(value))) {
12
+ if (specifiers.length && CSS_EXTNAMES.includes((0, path_1.extname)(value))) {
13
13
  if (value.indexOf('?') >= 0) {
14
14
  source.value = `${value}&${opts.flag || 'cssmodules'}`;
15
15
  }
@@ -19,6 +19,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
19
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
20
20
  */
21
21
  import { PluginObj, types as BabelTypes } from '@babel/core';
22
- export default function ({ types: t, }: {
22
+ export default function ({ types: t }: {
23
23
  types: typeof BabelTypes;
24
24
  }): PluginObj;
@@ -23,14 +23,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
23
23
  // This file is https://github.com/jamiebuilds/react-loadable/blob/master/src/babel.js
24
24
  // Modified to also look for `shuvi/dynamic`
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- function default_1({ types: t, }) {
26
+ function default_1({ types: t }) {
27
27
  return {
28
28
  visitor: {
29
29
  ImportDeclaration(path) {
30
30
  let source = path.node.source.value;
31
- if (source !== '@shuvi/app')
31
+ if (source !== '@shuvi/runtime')
32
32
  return;
33
- let dynamicSpecifier = path.get('specifiers').find((specifier) => {
33
+ let dynamicSpecifier = path.get('specifiers').find(specifier => {
34
34
  return specifier.node.imported.name === 'dynamic';
35
35
  });
36
36
  if (!dynamicSpecifier)
@@ -40,7 +40,7 @@ function default_1({ types: t, }) {
40
40
  if (!binding) {
41
41
  return;
42
42
  }
43
- binding.referencePaths.forEach((refPath) => {
43
+ binding.referencePaths.forEach(refPath => {
44
44
  const callExpression = refPath.parentPath;
45
45
  if (!callExpression.isCallExpression())
46
46
  return;
@@ -68,7 +68,7 @@ function default_1({ types: t, }) {
68
68
  return;
69
69
  let properties = options.get('properties');
70
70
  let propertiesMap = {};
71
- properties.forEach((property) => {
71
+ properties.forEach(property => {
72
72
  const key = property.get('key');
73
73
  propertiesMap[key.node.name] = property;
74
74
  });
@@ -89,17 +89,17 @@ function default_1({ types: t, }) {
89
89
  return;
90
90
  const node = args[0].node;
91
91
  dynamicImports.push(node);
92
- },
92
+ }
93
93
  });
94
94
  if (!dynamicImports.length)
95
95
  return;
96
- options.node.properties.push(t.objectProperty(t.identifier('webpack'), t.arrowFunctionExpression([], t.arrayExpression(dynamicImports.map((dynamicImport) => {
96
+ options.node.properties.push(t.objectProperty(t.identifier('webpack'), t.arrowFunctionExpression([], t.arrayExpression(dynamicImports.map(dynamicImport => {
97
97
  return t.callExpression(t.memberExpression(t.identifier('require'), t.identifier('resolveWeak')), [dynamicImport]);
98
98
  })))));
99
99
  options.node.properties.push(t.objectProperty(t.identifier('modules'), t.arrayExpression(dynamicImports)));
100
100
  });
101
- },
102
- },
101
+ }
102
+ }
103
103
  };
104
104
  }
105
105
  exports.default = default_1;
@@ -1,4 +1,4 @@
1
1
  import { PluginObj, types as BabelTypes } from '@babel/core';
2
- export default function ({ types: t, }: {
2
+ export default function ({ types: t }: {
3
3
  types: typeof BabelTypes;
4
4
  }): PluginObj<any>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const isHook = /^use[A-Z]/;
7
7
  // matches only built-in hooks provided by React et al
8
8
  const isBuiltInHook = /^use(Callback|Context|DebugValue|Effect|ImperativeHandle|LayoutEffect|Memo|Reducer|Ref|State)$/;
9
- function default_1({ types: t, }) {
9
+ function default_1({ types: t }) {
10
10
  const visitor = {
11
11
  CallExpression(path, state) {
12
12
  const onlyBuiltIns = state.opts.onlyBuiltIns;
@@ -44,7 +44,7 @@ function default_1({ types: t, }) {
44
44
  }
45
45
  return patterns.concat(t.objectProperty(t.numericLiteral(i), element));
46
46
  }, []));
47
- },
47
+ }
48
48
  };
49
49
  return {
50
50
  name: 'optimize-hook-destructuring',
@@ -52,8 +52,8 @@ function default_1({ types: t, }) {
52
52
  // this is a workaround to run before preset-env destroys destructured assignments
53
53
  Program(path, state) {
54
54
  path.traverse(visitor, state);
55
- },
56
- },
55
+ }
56
+ }
57
57
  };
58
58
  }
59
59
  exports.default = default_1;
@@ -1,9 +1,29 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
26
+ const path = __importStar(require("path"));
7
27
  const env = process.env.NODE_ENV;
8
28
  const isProduction = env === 'production';
9
29
  const isDevelopment = env === 'development';
@@ -69,7 +89,7 @@ exports.default = (api, options = {}) => {
69
89
  }
70
90
  ],
71
91
  require('@babel/plugin-syntax-dynamic-import'),
72
- require('./plugins/loadable-plugin'),
92
+ require('./plugins/dynamic-plugin'),
73
93
  require('@babel/plugin-proposal-class-properties'),
74
94
  [
75
95
  require('@babel/plugin-proposal-object-rest-spread'),
@@ -83,7 +103,7 @@ exports.default = (api, options = {}) => {
83
103
  // Undocumented option that lets us encapsulate our runtime, ensuring
84
104
  // the correct version is used
85
105
  // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
86
- absoluteRuntime: path_1.default.dirname(require.resolve('@babel/runtime/package.json')) }, options['transform-runtime'])
106
+ absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json')) }, options['transform-runtime'])
87
107
  ],
88
108
  isProduction && [
89
109
  require('babel-plugin-transform-react-remove-prop-types'),
@@ -1 +1,2 @@
1
1
  export declare const AppSourceRegexs: RegExp[];
2
+ export declare const DEFAULT_TIMEOUT_MS = 5000;
package/lib/constants.js CHANGED
@@ -1,3 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppSourceRegexs = [/[/\\]shuvi-app[/\\]/];
3
+ exports.DEFAULT_TIMEOUT_MS = exports.AppSourceRegexs = void 0;
4
+ exports.AppSourceRegexs = [
5
+ /([/\\]shuvi-app[/\\])|([/\\]\.shuvi[/\\])/
6
+ ];
7
+ exports.DEFAULT_TIMEOUT_MS = 5000;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("a.css");
4
+ require("a");
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("a.css");
4
+ require("a");
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent1 = (0, runtime_1.dynamic)(() => import('../components/hello1'));
5
+ const DynamicComponent2 = (0, runtime_1.dynamic)(() => import('../components/hello2'));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent1 = (0, runtime_1.dynamic)(() => import('../components/hello1'), {
5
+ webpack: () => [require.resolveWeak('../components/hello1')],
6
+ modules: ['../components/hello1']
7
+ });
8
+ const DynamicComponent2 = (0, runtime_1.dynamic)(() => import('../components/hello2'), {
9
+ webpack: () => [require.resolveWeak('../components/hello2')],
10
+ modules: ['../components/hello2']
11
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const runtime_1 = require("@shuvi/runtime");
7
+ const something_else_1 = __importDefault(require("something-else"));
8
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'));
9
+ something_else_1.default.dynamic('should not be transformed');
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const runtime_1 = require("@shuvi/runtime");
7
+ const something_else_1 = __importDefault(require("something-else"));
8
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'), {
9
+ webpack: () => [require.resolveWeak('../components/hello')],
10
+ modules: ['../components/hello']
11
+ });
12
+ something_else_1.default.dynamic('should not be transformed');
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'));
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'), {
5
+ webpack: () => [require.resolveWeak('../components/hello')],
6
+ modules: ['../components/hello']
7
+ });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponentWithCustomLoading = (0, runtime_1.dynamic)(() => import('../components/hello'), { loading: () => React.createElement("p", null, "...") });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponentWithCustomLoading = (0, runtime_1.dynamic)(() => import('../components/hello'), {
5
+ webpack: () => [require.resolveWeak('../components/hello')],
6
+ modules: ['../components/hello'],
7
+ loading: () => React.createElement("p", null, "...")
8
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => handleImport(import('./components/hello')), {
5
+ loading: () => null,
6
+ ssr: false
7
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => handleImport(import('./components/hello')), {
5
+ webpack: () => [require.resolveWeak('./components/hello')],
6
+ modules: ['./components/hello'],
7
+ loading: () => null,
8
+ ssr: false
9
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent1 = (0, runtime_1.dynamic)(() => import('../components/hello1'));
5
+ const DynamicComponent2 = (0, runtime_1.dynamic)(() => import('../components/hello2'));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent1 = (0, runtime_1.dynamic)(() => import('../components/hello1'), {
5
+ webpack: () => [require.resolve('../components/hello1')],
6
+ modules: ['../components/hello1']
7
+ });
8
+ const DynamicComponent2 = (0, runtime_1.dynamic)(() => import('../components/hello2'), {
9
+ webpack: () => [require.resolve('../components/hello2')],
10
+ modules: ['../components/hello2']
11
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const runtime_1 = require("@shuvi/runtime");
7
+ const something_else_1 = __importDefault(require("something-else"));
8
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'));
9
+ something_else_1.default.dynamic('should not be transformed');
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const runtime_1 = require("@shuvi/runtime");
7
+ const something_else_1 = __importDefault(require("something-else"));
8
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'), {
9
+ webpack: () => [require.resolve('../components/hello')],
10
+ modules: ['../components/hello']
11
+ });
12
+ something_else_1.default.dynamic('should not be transformed');
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'));
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => import('../components/hello'), {
5
+ webpack: () => [require.resolve('../components/hello')],
6
+ modules: ['../components/hello']
7
+ });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponentWithCustomLoading = (0, runtime_1.dynamic)(() => import('../components/hello'), { loading: () => React.createElement("p", null, "...") });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponentWithCustomLoading = (0, runtime_1.dynamic)(() => import('../components/hello'), {
5
+ webpack: () => [require.resolve('../components/hello')],
6
+ modules: ['../components/hello'],
7
+ loading: () => React.createElement("p", null, "...")
8
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => handleImport(import('./components/hello')), {
5
+ loading: () => null,
6
+ ssr: false
7
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const runtime_1 = require("@shuvi/runtime");
4
+ const DynamicComponent = (0, runtime_1.dynamic)(() => handleImport(import('./components/hello')), {
5
+ webpack: () => [require.resolve('./components/hello')],
6
+ modules: ['./components/hello'],
7
+ loading: () => null,
8
+ ssr: false
9
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const esm_1 = __importDefault(require("esm"));
7
+ console.log(esm_1.default.foo);
8
+ module.exports = esm_1.default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var _esm = _interopRequireDefault(require("esm"));
3
+ function _interopRequireDefault(a) {
4
+ return a && a.__esModule ? a : {
5
+ default: a
6
+ };
7
+ }
8
+ console.log(_esm.default.foo), module.exports = _esm.default;
@@ -0,0 +1,2 @@
1
+ export declare function build(dir: string, mode: string): Promise<void>;
2
+ export declare function buildToString(entry: string): Promise<string>;