@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.
- package/lib/babel/plugins/auto-css-modules.js +1 -1
- package/lib/babel/plugins/{loadable-plugin.d.ts → dynamic-plugin.d.ts} +1 -1
- package/lib/babel/plugins/{loadable-plugin.js → dynamic-plugin.js} +9 -9
- package/lib/babel/plugins/optimize-hook-destructuring.d.ts +1 -1
- package/lib/babel/plugins/optimize-hook-destructuring.js +4 -4
- package/lib/babel/preset.js +25 -5
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +5 -1
- package/lib/swc/tests/fixture/auto-css-module/no-flag/input.d.ts +1 -0
- package/lib/swc/tests/fixture/auto-css-module/no-flag/input.js +4 -0
- package/lib/swc/tests/fixture/auto-css-module/no-flag/output.d.ts +1 -0
- package/lib/swc/tests/fixture/auto-css-module/no-flag/output.js +4 -0
- package/lib/swc/tests/fixture/auto-css-module/with-flag/input.d.ts +1 -0
- package/lib/swc/tests/fixture/auto-css-module/with-flag/input.js +2 -0
- package/lib/swc/tests/fixture/auto-css-module/with-flag/output.d.ts +1 -0
- package/lib/swc/tests/fixture/auto-css-module/with-flag/output.js +2 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/input.js +5 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/duplicated-imports/output.js +11 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/input.js +9 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/member-with-same-name/output.js +12 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/no-options/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/no-options/input.js +4 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/no-options/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/no-options/output.js +7 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/with-options/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/with-options/input.js +4 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/with-options/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/with-options/output.js +8 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/input.js +7 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic/wrapped-import/output.js +9 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/input.js +5 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/duplicated-imports/output.js +11 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/input.js +9 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/member-with-same-name/output.js +12 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/input.js +4 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/no-options/output.js +7 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/input.js +4 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/with-options/output.js +8 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/input.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/input.js +7 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/output.d.ts +1 -0
- package/lib/swc/tests/fixture/shuvi-dynamic-disabled/wrapped-import/output.js +9 -0
- package/lib/swc/tests/full/auto-cjs/1/input.d.ts +1 -0
- package/lib/swc/tests/full/auto-cjs/1/input.js +8 -0
- package/lib/swc/tests/full/auto-cjs/1/output.d.ts +1 -0
- package/lib/swc/tests/full/auto-cjs/1/output.js +8 -0
- package/lib/utils/build-loaders.d.ts +2 -0
- package/lib/utils/build-loaders.js +131 -0
- package/lib/utils/bundle-require.d.ts +33 -0
- package/lib/utils/bundle-require.js +143 -0
- package/lib/utils/forkTsCheckerWebpackPlugin.js +2 -1
- package/lib/utils/formatWebpackMessages.d.ts +1 -1
- package/lib/utils/formatWebpackMessages.js +2 -1
- package/lib/utils/getSWCOptions.d.ts +91 -0
- package/lib/utils/getSWCOptions.js +66 -0
- package/lib/utils/hotDevClient/eventsource.js +1 -0
- package/lib/utils/hotDevClient/index.js +117 -33
- package/lib/utils/hotDevClient/websocket.d.ts +13 -0
- package/lib/utils/hotDevClient/websocket.js +59 -0
- package/lib/utils/load-sources.d.ts +3 -0
- package/lib/utils/load-sources.js +96 -0
- package/lib/webpack/config/base.d.ts +15 -4
- package/lib/webpack/config/base.js +108 -85
- package/lib/webpack/config/browser.d.ts +3 -4
- package/lib/webpack/config/browser.js +87 -34
- package/lib/webpack/config/index.js +18 -7
- package/lib/webpack/config/node.d.ts +3 -4
- package/lib/webpack/config/node.js +19 -26
- package/lib/webpack/config/parts/external.d.ts +3 -2
- package/lib/webpack/config/parts/external.js +16 -10
- package/lib/webpack/config/parts/helpers.d.ts +2 -1
- package/lib/webpack/config/parts/helpers.js +7 -1
- package/lib/webpack/config/parts/resolve.js +1 -0
- package/lib/webpack/config/parts/style.d.ts +5 -2
- package/lib/webpack/config/parts/style.js +125 -60
- package/lib/webpack/dynamic-dll/bundler/index.d.ts +22 -0
- package/lib/webpack/dynamic-dll/bundler/index.js +211 -0
- package/lib/webpack/dynamic-dll/bundler/webpack-config.d.ts +16 -0
- package/lib/webpack/dynamic-dll/bundler/webpack-config.js +116 -0
- package/lib/webpack/dynamic-dll/constants.d.ts +6 -0
- package/lib/webpack/dynamic-dll/constants.js +9 -0
- package/lib/webpack/dynamic-dll/dep/getCJSExports.d.ts +3 -0
- package/lib/webpack/dynamic-dll/dep/getCJSExports.js +58 -0
- package/lib/webpack/dynamic-dll/dep/getExposeFromContent.d.ts +1 -0
- package/lib/webpack/dynamic-dll/dep/getExposeFromContent.js +80 -0
- package/lib/webpack/dynamic-dll/dep/getModuleExports.d.ts +7 -0
- package/lib/webpack/dynamic-dll/dep/getModuleExports.js +46 -0
- package/lib/webpack/dynamic-dll/dep/index.d.ts +13 -0
- package/lib/webpack/dynamic-dll/dep/index.js +43 -0
- package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.d.ts +1 -0
- package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.js +15 -0
- package/lib/webpack/dynamic-dll/index.d.ts +35 -0
- package/lib/webpack/dynamic-dll/index.js +198 -0
- package/lib/webpack/dynamic-dll/metadata.d.ts +13 -0
- package/lib/webpack/dynamic-dll/metadata.js +62 -0
- package/lib/webpack/dynamic-dll/moduleCollector.d.ts +28 -0
- package/lib/webpack/dynamic-dll/moduleCollector.js +64 -0
- package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.d.ts +24 -0
- package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.js +70 -0
- package/lib/webpack/dynamic-dll/utils.d.ts +6 -0
- package/lib/webpack/dynamic-dll/utils.js +29 -0
- package/lib/webpack/index.d.ts +15 -0
- package/lib/webpack/index.js +110 -0
- package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.d.ts +4 -0
- package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.js +39 -0
- package/lib/webpack/loaders/parcel-css-loader/index.d.ts +4 -0
- package/lib/webpack/loaders/parcel-css-loader/index.js +369 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/api.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/api.js +85 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.js +23 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.js +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.js +16 -0
- package/lib/webpack/loaders/parcel-css-loader/utils.d.ts +28 -0
- package/lib/webpack/loaders/parcel-css-loader/utils.js +869 -0
- package/lib/webpack/loaders/route-component-loader.js +25 -5
- package/lib/webpack/loaders/shuvi-swc-loader.d.ts +2 -0
- package/lib/webpack/loaders/shuvi-swc-loader.js +96 -0
- package/lib/webpack/plugins/build-manifest-plugin.js +44 -23
- package/lib/webpack/plugins/dynamic-public-path-plugin.d.ts +9 -0
- package/lib/webpack/plugins/dynamic-public-path-plugin.js +50 -0
- package/lib/webpack/plugins/fix-watching-plugin.d.ts +4 -0
- package/lib/webpack/plugins/fix-watching-plugin.js +23 -0
- package/lib/webpack/plugins/jsconfig-paths-plugin.d.ts +44 -0
- package/lib/webpack/plugins/jsconfig-paths-plugin.js +228 -0
- package/lib/webpack/plugins/module-replace-plugin/index.js +5 -1
- package/lib/webpack/plugins/module-replace-plugin/plugin.d.ts +6 -6
- package/lib/webpack/plugins/module-replace-plugin/plugin.js +47 -32
- package/lib/webpack/plugins/module-replace-plugin/stub-loader.js +47 -7
- package/lib/webpack/plugins/require-cache-hot-reloader-plugin.js +9 -8
- package/lib/webpack/plugins/support-ts-extension-resolver-plugin.d.ts +4 -0
- package/lib/webpack/plugins/support-ts-extension-resolver-plugin.js +23 -0
- package/lib/webpack/types.d.ts +40 -0
- package/lib/webpack/types.js +2 -0
- package/package.json +77 -39
- package/lib/utils/emptyComponent.d.ts +0 -1
- package/lib/utils/emptyComponent.js +0 -7
- package/lib/utils/errorOverlayMiddleware.d.ts +0 -1
- package/lib/utils/errorOverlayMiddleware.js +0 -21
- package/lib/utils/verifyTypeScriptSetup.d.ts +0 -5
- package/lib/utils/verifyTypeScriptSetup.js +0 -229
- package/lib/webpack/loaders/export-global-loader.d.ts +0 -7
- 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/
|
|
31
|
+
if (source !== '@shuvi/runtime')
|
|
32
32
|
return;
|
|
33
|
-
let dynamicSpecifier = path.get('specifiers').find(
|
|
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(
|
|
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(
|
|
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(
|
|
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;
|
|
@@ -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;
|
package/lib/babel/preset.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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
|
|
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/
|
|
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:
|
|
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'),
|
package/lib/constants.d.ts
CHANGED
package/lib/constants.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppSourceRegexs =
|
|
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 {};
|