@modern-js/server-utils 2.69.5 → 3.0.0-alpha.0
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/dist/cjs/common/index.js +58 -62
- package/dist/cjs/compilers/babel/index.js +145 -101
- package/dist/cjs/compilers/babel/preset/alias.js +123 -105
- package/dist/cjs/compilers/babel/preset/index.js +102 -68
- package/dist/cjs/compilers/babel/preset/types.js +17 -15
- package/dist/cjs/compilers/typescript/index.js +112 -119
- package/dist/cjs/compilers/typescript/tsconfigPathsPlugin.js +157 -191
- package/dist/cjs/compilers/typescript/typescriptLoader.js +47 -41
- package/dist/cjs/index.js +68 -28
- package/dist/esm/common/index.mjs +29 -0
- package/dist/esm/compilers/babel/index.mjs +57 -0
- package/dist/esm/compilers/babel/preset/alias.mjs +84 -0
- package/dist/esm/compilers/babel/preset/index.mjs +29 -0
- package/dist/esm/compilers/typescript/index.mjs +76 -0
- package/dist/esm/compilers/typescript/tsconfigPathsPlugin.mjs +126 -0
- package/dist/esm/compilers/typescript/typescriptLoader.mjs +20 -0
- package/dist/{esm-node/index.js → esm/index.mjs} +2 -4
- package/dist/esm-node/common/index.mjs +29 -0
- package/dist/esm-node/compilers/babel/index.mjs +57 -0
- package/dist/esm-node/compilers/babel/preset/alias.mjs +84 -0
- package/dist/esm-node/compilers/babel/preset/index.mjs +29 -0
- package/dist/esm-node/compilers/typescript/index.mjs +76 -0
- package/dist/esm-node/compilers/typescript/tsconfigPathsPlugin.mjs +126 -0
- package/dist/esm-node/compilers/typescript/typescriptLoader.mjs +20 -0
- package/dist/esm-node/index.mjs +3 -0
- package/package.json +32 -24
- package/rslib.config.mts +4 -0
- package/dist/esm/common/index.js +0 -97
- package/dist/esm/compilers/babel/index.js +0 -119
- package/dist/esm/compilers/babel/preset/alias.js +0 -70
- package/dist/esm/compilers/babel/preset/index.js +0 -36
- package/dist/esm/compilers/typescript/index.js +0 -202
- package/dist/esm/compilers/typescript/tsconfigPathsPlugin.js +0 -188
- package/dist/esm/compilers/typescript/typescriptLoader.js +0 -30
- package/dist/esm/index.js +0 -5
- package/dist/esm-node/common/index.js +0 -35
- package/dist/esm-node/compilers/babel/index.js +0 -66
- package/dist/esm-node/compilers/babel/preset/alias.js +0 -76
- package/dist/esm-node/compilers/babel/preset/index.js +0 -36
- package/dist/esm-node/compilers/typescript/index.js +0 -93
- package/dist/esm-node/compilers/typescript/tsconfigPathsPlugin.js +0 -170
- package/dist/esm-node/compilers/typescript/typescriptLoader.js +0 -24
- /package/dist/esm/compilers/babel/preset/{types.js → types.mjs} +0 -0
- /package/dist/esm-node/compilers/babel/preset/{types.js → types.mjs} +0 -0
|
@@ -1,73 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var preset_exports = {};
|
|
31
|
-
__export(preset_exports, {
|
|
32
|
-
applyUserBabelConfig: () => import_utils.applyUserBabelConfig,
|
|
33
|
-
getBabelConfig: () => getBabelConfig
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(preset_exports);
|
|
36
|
-
var import_node = require("@modern-js/babel-preset/node");
|
|
37
|
-
var import_alias = require("./alias");
|
|
38
|
-
__reExport(preset_exports, require("./types"), module.exports);
|
|
39
|
-
var import_utils = require("@modern-js/utils");
|
|
40
|
-
const getBabelConfig = (libPresetOption) => {
|
|
41
|
-
var _config_presets, _config_plugins;
|
|
42
|
-
const { isEsm } = libPresetOption;
|
|
43
|
-
const config = (0, import_node.getBabelConfigForNode)({
|
|
44
|
-
presetEnv: {
|
|
45
|
-
loose: true,
|
|
46
|
-
modules: isEsm ? false : "commonjs",
|
|
47
|
-
targets: [
|
|
48
|
-
"node >= 14"
|
|
49
|
-
]
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./alias" (module) {
|
|
4
|
+
module.exports = require("./alias.js");
|
|
50
5
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
6
|
+
"./types" (module) {
|
|
7
|
+
module.exports = require("./types.js");
|
|
8
|
+
},
|
|
9
|
+
"@modern-js/babel-preset/node" (module) {
|
|
10
|
+
module.exports = require("@modern-js/babel-preset/node");
|
|
11
|
+
},
|
|
12
|
+
"@modern-js/utils" (module) {
|
|
13
|
+
module.exports = require("@modern-js/utils");
|
|
59
14
|
}
|
|
60
|
-
]);
|
|
61
|
-
if (libPresetOption.alias) {
|
|
62
|
-
var _config_plugins1;
|
|
63
|
-
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push((0, import_alias.aliasPlugin)(libPresetOption.alias));
|
|
64
|
-
}
|
|
65
|
-
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(require.resolve("babel-plugin-transform-typescript-metadata"));
|
|
66
|
-
return config;
|
|
67
15
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
16
|
+
var __webpack_module_cache__ = {};
|
|
17
|
+
function __webpack_require__(moduleId) {
|
|
18
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
19
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
20
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
21
|
+
exports: {}
|
|
22
|
+
};
|
|
23
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
24
|
+
return module.exports;
|
|
25
|
+
}
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.n = (module)=>{
|
|
28
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
29
|
+
__webpack_require__.d(getter, {
|
|
30
|
+
a: getter
|
|
31
|
+
});
|
|
32
|
+
return getter;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
(()=>{
|
|
36
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
37
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: definition[key]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
(()=>{
|
|
44
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
45
|
+
})();
|
|
46
|
+
(()=>{
|
|
47
|
+
__webpack_require__.r = (exports1)=>{
|
|
48
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
49
|
+
value: 'Module'
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
52
|
+
value: true
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
var __webpack_exports__ = {};
|
|
57
|
+
(()=>{
|
|
58
|
+
__webpack_require__.r(__webpack_exports__);
|
|
59
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
+
applyUserBabelConfig: ()=>_modern_js_utils__rspack_import_3.applyUserBabelConfig,
|
|
61
|
+
getBabelConfig: ()=>getBabelConfig
|
|
62
|
+
});
|
|
63
|
+
var _modern_js_babel_preset_node__rspack_import_0 = __webpack_require__("@modern-js/babel-preset/node");
|
|
64
|
+
var _alias__rspack_import_1 = __webpack_require__("./alias");
|
|
65
|
+
var _types__rspack_import_2 = __webpack_require__("./types");
|
|
66
|
+
var __rspack_reexport = {};
|
|
67
|
+
for(const __rspack_import_key in _types__rspack_import_2)if ([
|
|
68
|
+
"applyUserBabelConfig",
|
|
69
|
+
"getBabelConfig",
|
|
70
|
+
"default"
|
|
71
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_2[__rspack_import_key];
|
|
72
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
73
|
+
var _modern_js_utils__rspack_import_3 = __webpack_require__("@modern-js/utils");
|
|
74
|
+
const getBabelConfig = (libPresetOption)=>{
|
|
75
|
+
const { isEsm } = libPresetOption;
|
|
76
|
+
const config = (0, _modern_js_babel_preset_node__rspack_import_0.getBabelConfigForNode)({
|
|
77
|
+
presetEnv: {
|
|
78
|
+
loose: true,
|
|
79
|
+
modules: isEsm ? false : 'commonjs',
|
|
80
|
+
targets: [
|
|
81
|
+
'node >= 14'
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
pluginDecorators: {
|
|
85
|
+
version: 'legacy'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
config.presets?.push([
|
|
89
|
+
require.resolve('@babel/preset-react'),
|
|
90
|
+
{
|
|
91
|
+
runtime: 'automatic'
|
|
92
|
+
}
|
|
93
|
+
]);
|
|
94
|
+
if (libPresetOption.alias) config.plugins?.push((0, _alias__rspack_import_1.aliasPlugin)(libPresetOption.alias));
|
|
95
|
+
config.plugins?.push(require.resolve("babel-plugin-transform-typescript-metadata"));
|
|
96
|
+
return config;
|
|
97
|
+
};
|
|
98
|
+
})();
|
|
99
|
+
exports.applyUserBabelConfig = __webpack_exports__.applyUserBabelConfig;
|
|
100
|
+
exports.getBabelConfig = __webpack_exports__.getBabelConfig;
|
|
101
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
102
|
+
"applyUserBabelConfig",
|
|
103
|
+
"getBabelConfig"
|
|
104
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
105
|
+
Object.defineProperty(exports, '__esModule', {
|
|
106
|
+
value: true
|
|
73
107
|
});
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -1,127 +1,120 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
compileByTs: ()=>compileByTs
|
|
32
37
|
});
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const readTsConfigByFile = (tsConfigFile, tsInstance)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
const external_path_namespaceObject = require("path");
|
|
39
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
40
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
41
|
+
const external_tsconfigPathsPlugin_js_namespaceObject = require("./tsconfigPathsPlugin.js");
|
|
42
|
+
const external_typescriptLoader_js_namespaceObject = require("./typescriptLoader.js");
|
|
43
|
+
const readTsConfigByFile = (tsConfigFile, tsInstance)=>{
|
|
44
|
+
const parsedCmd = tsInstance.getParsedCommandLineOfConfigFile(tsConfigFile, void 0, tsInstance.sys);
|
|
45
|
+
const { options, fileNames, projectReferences } = parsedCmd;
|
|
46
|
+
return {
|
|
47
|
+
options,
|
|
48
|
+
fileNames,
|
|
49
|
+
projectReferences
|
|
50
|
+
};
|
|
46
51
|
};
|
|
47
|
-
const copyFiles = async (from, to, appDirectory)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const copyFiles = async (from, to, appDirectory)=>{
|
|
53
|
+
if (await utils_namespaceObject.fs.pathExists(from)) {
|
|
54
|
+
const relativePath = external_path_default().relative(appDirectory, from);
|
|
55
|
+
const targetDir = external_path_default().join(to, relativePath);
|
|
56
|
+
await utils_namespaceObject.fs.copy(from, targetDir, {
|
|
57
|
+
filter: (src)=>![
|
|
58
|
+
'.ts',
|
|
59
|
+
'.js'
|
|
60
|
+
].includes(external_path_default().extname(src)) && !src.endsWith('tsconfig.json')
|
|
61
|
+
});
|
|
62
|
+
}
|
|
58
63
|
};
|
|
59
|
-
const compileByTs = async (appDirectory, config, compileOptions)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
appDirectory,
|
|
73
|
-
tsconfigPath
|
|
74
|
-
});
|
|
75
|
-
const { paths = {}, absoluteBaseUrl = "./" } = aliasOption;
|
|
76
|
-
const { options, fileNames, projectReferences } = readTsConfigByFile(tsconfigPath, ts);
|
|
77
|
-
const sourcePosixPaths = sourceDirs.map((sourceDir) => sourceDir.split(import_path.default.sep).join(import_path.default.posix.sep));
|
|
78
|
-
const rootNames = fileNames.filter((fileName) => {
|
|
79
|
-
return fileName.endsWith(".d.ts") || sourcePosixPaths.some((sourceDir) => {
|
|
80
|
-
return fileName.includes(sourceDir);
|
|
64
|
+
const compileByTs = async (appDirectory, config, compileOptions)=>{
|
|
65
|
+
utils_namespaceObject.logger.info("Running ts compile...");
|
|
66
|
+
const { sourceDirs, distDir, tsconfigPath } = compileOptions;
|
|
67
|
+
if (!tsconfigPath) return;
|
|
68
|
+
const ts = new external_typescriptLoader_js_namespaceObject.TypescriptLoader({
|
|
69
|
+
appDirectory
|
|
70
|
+
}).load();
|
|
71
|
+
const createProgram = ts.createIncrementalProgram || ts.createProgram;
|
|
72
|
+
const formatHost = getFormatHost(ts);
|
|
73
|
+
const { alias } = config;
|
|
74
|
+
const aliasOption = (0, utils_namespaceObject.getAliasConfig)(alias, {
|
|
75
|
+
appDirectory,
|
|
76
|
+
tsconfigPath
|
|
81
77
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
process.exit(1);
|
|
109
|
-
}
|
|
78
|
+
const { paths = {}, absoluteBaseUrl = './' } = aliasOption;
|
|
79
|
+
const { options, fileNames, projectReferences } = readTsConfigByFile(tsconfigPath, ts);
|
|
80
|
+
const sourcePosixPaths = sourceDirs.map((sourceDir)=>sourceDir.split(external_path_default().sep).join(external_path_default().posix.sep));
|
|
81
|
+
const rootNames = fileNames.filter((fileName)=>fileName.endsWith('.d.ts') || sourcePosixPaths.some((sourceDir)=>fileName.includes(sourceDir)));
|
|
82
|
+
const program = createProgram.call(ts, {
|
|
83
|
+
rootNames,
|
|
84
|
+
projectReferences,
|
|
85
|
+
options: {
|
|
86
|
+
rootDir: appDirectory,
|
|
87
|
+
outDir: distDir,
|
|
88
|
+
...options
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const tsconfigPathsPlugin = (0, external_tsconfigPathsPlugin_js_namespaceObject.tsconfigPathsBeforeHookFactory)(ts, absoluteBaseUrl, paths);
|
|
92
|
+
const emitResult = program.emit(void 0, void 0, void 0, void 0, {
|
|
93
|
+
before: [
|
|
94
|
+
tsconfigPathsPlugin
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
98
|
+
const { noEmitOnError } = options;
|
|
99
|
+
if (allDiagnostics.length > 0) {
|
|
100
|
+
utils_namespaceObject.logger.error(ts.formatDiagnosticsWithColorAndContext([
|
|
101
|
+
...new Set(allDiagnostics)
|
|
102
|
+
], formatHost));
|
|
103
|
+
if (void 0 === noEmitOnError || true === noEmitOnError) if (compileOptions.throwErrorInsteadOfExit) utils_namespaceObject.logger.error('TypeScript compilation failed');
|
|
104
|
+
else process.exit(1);
|
|
110
105
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
await copyFiles(source, distDir, appDirectory);
|
|
114
|
-
}
|
|
115
|
-
import_utils.logger.info(`Ts compile succeed`);
|
|
106
|
+
for (const source of sourceDirs)await copyFiles(source, distDir, appDirectory);
|
|
107
|
+
utils_namespaceObject.logger.info("Ts compile succeed");
|
|
116
108
|
};
|
|
117
|
-
const getFormatHost = (ts)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
const getFormatHost = (ts)=>({
|
|
110
|
+
getCanonicalFileName: (path)=>path,
|
|
111
|
+
getCurrentDirectory: ts.sys.getCurrentDirectory,
|
|
112
|
+
getNewLine: ()=>ts.sys.newLine
|
|
113
|
+
});
|
|
114
|
+
exports.compileByTs = __webpack_exports__.compileByTs;
|
|
115
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
116
|
+
"compileByTs"
|
|
117
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
118
|
+
Object.defineProperty(exports, '__esModule', {
|
|
119
|
+
value: true
|
|
127
120
|
});
|