@modern-js/babel-compiler 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/build.js +68 -73
- package/dist/cjs/buildWatch.js +111 -116
- package/dist/cjs/compiler.js +103 -116
- package/dist/cjs/compilerErrorResult.js +61 -56
- package/dist/cjs/constants.js +36 -28
- package/dist/cjs/defaults.js +46 -38
- package/dist/cjs/getFinalOption.js +82 -83
- package/dist/cjs/index.js +92 -44
- package/dist/cjs/type.js +17 -15
- package/dist/cjs/utils.js +34 -37
- package/dist/cjs/validate.js +70 -64
- package/dist/esm/build.mjs +42 -0
- package/dist/esm/buildWatch.mjs +78 -0
- package/dist/esm/compiler.mjs +76 -0
- package/dist/esm/compilerErrorResult.mjs +34 -0
- package/dist/esm/constants.mjs +7 -0
- package/dist/esm/defaults.mjs +17 -0
- package/dist/esm/getFinalOption.mjs +50 -0
- package/dist/{esm-node/index.js → esm/index.mjs} +7 -14
- package/dist/esm/utils.mjs +5 -0
- package/dist/esm/validate.mjs +32 -0
- package/dist/esm-node/build.mjs +42 -0
- package/dist/esm-node/buildWatch.mjs +78 -0
- package/dist/esm-node/compiler.mjs +76 -0
- package/dist/esm-node/compilerErrorResult.mjs +34 -0
- package/dist/esm-node/constants.mjs +7 -0
- package/dist/esm-node/defaults.mjs +17 -0
- package/dist/esm-node/getFinalOption.mjs +50 -0
- package/dist/esm-node/index.mjs +14 -0
- package/dist/esm-node/utils.mjs +5 -0
- package/dist/esm-node/validate.mjs +32 -0
- package/package.json +24 -17
- package/rslib.config.mts +4 -0
- package/rstest.config.ts +7 -0
- package/dist/esm/build.js +0 -105
- package/dist/esm/buildWatch.js +0 -157
- package/dist/esm/compiler.js +0 -95
- package/dist/esm/compilerErrorResult.js +0 -71
- package/dist/esm/constants.js +0 -9
- package/dist/esm/defaults.js +0 -19
- package/dist/esm/getFinalOption.js +0 -68
- package/dist/esm/index.js +0 -46
- package/dist/esm/utils.js +0 -7
- package/dist/esm/validate.js +0 -44
- package/dist/esm-node/build.js +0 -57
- package/dist/esm-node/buildWatch.js +0 -89
- package/dist/esm-node/compiler.js +0 -95
- package/dist/esm-node/compilerErrorResult.js +0 -39
- package/dist/esm-node/constants.js +0 -9
- package/dist/esm-node/defaults.js +0 -19
- package/dist/esm-node/getFinalOption.js +0 -67
- package/dist/esm-node/utils.js +0 -8
- package/dist/esm-node/validate.js +0 -44
- /package/dist/esm/{type.js → type.mjs} +0 -0
- /package/dist/esm-node/{type.js → type.mjs} +0 -0
|
@@ -1,63 +1,68 @@
|
|
|
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
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CompilerErrorResult: ()=>CompilerErrorResult
|
|
22
28
|
});
|
|
23
|
-
module.exports = __toCommonJS(compilerErrorResult_exports);
|
|
24
29
|
class CompilerErrorResult {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
init(initErrorResult) {
|
|
31
|
+
this._messageDetails = initErrorResult?.messageDetails || [];
|
|
32
|
+
}
|
|
33
|
+
update(messageDetails) {
|
|
34
|
+
for (const messageDetail of messageDetails){
|
|
35
|
+
const addError = !this._messageDetails.some((detail)=>{
|
|
36
|
+
if (detail.filename === messageDetail.filename) {
|
|
37
|
+
detail.content = messageDetail.content;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
});
|
|
42
|
+
if (addError) this._messageDetails.push(messageDetail);
|
|
34
43
|
}
|
|
35
|
-
return false;
|
|
36
|
-
});
|
|
37
|
-
if (addError) {
|
|
38
|
-
this._messageDetails.push(messageDetail);
|
|
39
|
-
}
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.init(initErrorResult);
|
|
58
|
-
}
|
|
45
|
+
removeByFileName(filename) {
|
|
46
|
+
this._messageDetails = this._messageDetails.filter((detail)=>detail.filename !== filename);
|
|
47
|
+
}
|
|
48
|
+
get value() {
|
|
49
|
+
return {
|
|
50
|
+
code: 1,
|
|
51
|
+
message: `Compilation failure ${this._messageDetails?.length} files with Babel.`,
|
|
52
|
+
messageDetails: this._messageDetails
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
checkExistError() {
|
|
56
|
+
return this._messageDetails.length > 0;
|
|
57
|
+
}
|
|
58
|
+
constructor(initErrorResult){
|
|
59
|
+
this.init(initErrorResult);
|
|
60
|
+
}
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
exports.CompilerErrorResult = __webpack_exports__.CompilerErrorResult;
|
|
63
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
64
|
+
"CompilerErrorResult"
|
|
65
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
66
|
+
Object.defineProperty(exports, '__esModule', {
|
|
67
|
+
value: true
|
|
63
68
|
});
|
package/dist/cjs/constants.js
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
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
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
defaultDistFileExtMap: ()=>defaultDistFileExtMap
|
|
22
28
|
});
|
|
23
|
-
module.exports = __toCommonJS(constants_exports);
|
|
24
29
|
const defaultDistFileExtMap = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
'.js': '.js',
|
|
31
|
+
'.jsx': '.js',
|
|
32
|
+
'.ts': '.js',
|
|
33
|
+
'.tsx': '.js'
|
|
29
34
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
exports.defaultDistFileExtMap = __webpack_exports__.defaultDistFileExtMap;
|
|
36
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
37
|
+
"defaultDistFileExtMap"
|
|
38
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
39
|
+
Object.defineProperty(exports, '__esModule', {
|
|
40
|
+
value: true
|
|
33
41
|
});
|
package/dist/cjs/defaults.js
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
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
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
mergeDefaultOption: ()=>mergeDefaultOption
|
|
22
28
|
});
|
|
23
|
-
|
|
24
|
-
var import_constants = require("./constants");
|
|
29
|
+
const external_constants_js_namespaceObject = require("./constants.js");
|
|
25
30
|
const defaultOptions = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
enableWatch: false,
|
|
32
|
+
enableVirtualDist: false,
|
|
33
|
+
extensions: [],
|
|
34
|
+
filenames: [],
|
|
35
|
+
distFileExtMap: external_constants_js_namespaceObject.defaultDistFileExtMap,
|
|
36
|
+
ignore: [],
|
|
37
|
+
quiet: false,
|
|
38
|
+
verbose: false,
|
|
39
|
+
clean: false
|
|
35
40
|
};
|
|
36
|
-
const mergeDefaultOption = (compilerOptions)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const mergeDefaultOption = (compilerOptions)=>({
|
|
42
|
+
...defaultOptions,
|
|
43
|
+
...compilerOptions
|
|
44
|
+
});
|
|
45
|
+
exports.mergeDefaultOption = __webpack_exports__.mergeDefaultOption;
|
|
46
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
47
|
+
"mergeDefaultOption"
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
|
+
Object.defineProperty(exports, '__esModule', {
|
|
50
|
+
value: true
|
|
43
51
|
});
|
|
@@ -1,94 +1,93 @@
|
|
|
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
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getFinalExtensions: ()=>getFinalExtensions,
|
|
28
|
+
getFinalCompilerOption: ()=>getFinalCompilerOption,
|
|
29
|
+
getGlobPattern: ()=>getGlobPattern,
|
|
30
|
+
getFilesFromDir: ()=>getFilesFromDir
|
|
25
31
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return `${dir}/**/*{${extensions.join(",")}}`;
|
|
33
|
-
} else if (extensions.length === 1) {
|
|
34
|
-
return `${dir}/**/*${extensions[0]}`;
|
|
35
|
-
} else {
|
|
32
|
+
const core_namespaceObject = require("@babel/core");
|
|
33
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
34
|
+
const external_defaults_js_namespaceObject = require("./defaults.js");
|
|
35
|
+
const getGlobPattern = (dir, extensions)=>{
|
|
36
|
+
if (extensions.length > 1) return `${dir}/**/*{${extensions.join(',')}}`;
|
|
37
|
+
if (1 === extensions.length) return `${dir}/**/*${extensions[0]}`;
|
|
36
38
|
return `${dir}/**/*`;
|
|
37
|
-
}
|
|
38
39
|
};
|
|
39
|
-
const getFinalExtensions = (extensions)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...import_core.DEFAULT_EXTENSIONS
|
|
40
|
+
const getFinalExtensions = (extensions)=>{
|
|
41
|
+
const isExtensions = (ext)=>Array.isArray(ext);
|
|
42
|
+
const isExtensionsFunc = (ext)=>'function' == typeof ext;
|
|
43
|
+
if (isExtensions(extensions)) return [
|
|
44
|
+
...extensions,
|
|
45
|
+
...core_namespaceObject.DEFAULT_EXTENSIONS
|
|
46
46
|
];
|
|
47
|
-
|
|
48
|
-
return
|
|
49
|
-
} else {
|
|
50
|
-
return import_core.DEFAULT_EXTENSIONS;
|
|
51
|
-
}
|
|
47
|
+
if (isExtensionsFunc(extensions)) return extensions(core_namespaceObject.DEFAULT_EXTENSIONS);
|
|
48
|
+
return core_namespaceObject.DEFAULT_EXTENSIONS;
|
|
52
49
|
};
|
|
53
|
-
const getFilesFromDir = ({ dir, finalExt = [], ignore = [] })
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
const getFilesFromDir = ({ dir, finalExt = [], ignore = [] })=>{
|
|
51
|
+
let globFindFilenames = [];
|
|
52
|
+
const globPattern = getGlobPattern(dir, finalExt);
|
|
53
|
+
globFindFilenames = utils_namespaceObject.glob.sync(globPattern, {
|
|
54
|
+
ignore
|
|
55
|
+
});
|
|
56
|
+
return globFindFilenames;
|
|
60
57
|
};
|
|
61
|
-
const getFinalCompilerOption = (option)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
finalExt
|
|
58
|
+
const getFinalCompilerOption = (option)=>{
|
|
59
|
+
const optionWithDefault = (0, external_defaults_js_namespaceObject.mergeDefaultOption)(option);
|
|
60
|
+
const { sourceDir, ignore, enableWatch = false, watchDir, extensions = core_namespaceObject.DEFAULT_EXTENSIONS } = option;
|
|
61
|
+
let globFindFilenames = [];
|
|
62
|
+
const finalExt = getFinalExtensions(extensions);
|
|
63
|
+
if (sourceDir) globFindFilenames = getFilesFromDir({
|
|
64
|
+
dir: sourceDir,
|
|
65
|
+
ignore,
|
|
66
|
+
finalExt
|
|
71
67
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ignore,
|
|
77
|
-
finalExt
|
|
68
|
+
if (enableWatch) globFindFilenames = getFilesFromDir({
|
|
69
|
+
dir: watchDir,
|
|
70
|
+
ignore,
|
|
71
|
+
finalExt
|
|
78
72
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
73
|
+
return {
|
|
74
|
+
...optionWithDefault,
|
|
75
|
+
filenames: [
|
|
76
|
+
...optionWithDefault.filenames,
|
|
77
|
+
...globFindFilenames
|
|
78
|
+
]
|
|
79
|
+
};
|
|
87
80
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
exports.getFilesFromDir = __webpack_exports__.getFilesFromDir;
|
|
82
|
+
exports.getFinalCompilerOption = __webpack_exports__.getFinalCompilerOption;
|
|
83
|
+
exports.getFinalExtensions = __webpack_exports__.getFinalExtensions;
|
|
84
|
+
exports.getGlobPattern = __webpack_exports__.getGlobPattern;
|
|
85
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
86
|
+
"getFilesFromDir",
|
|
87
|
+
"getFinalCompilerOption",
|
|
88
|
+
"getFinalExtensions",
|
|
89
|
+
"getGlobPattern"
|
|
90
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
91
|
+
Object.defineProperty(exports, '__esModule', {
|
|
92
|
+
value: true
|
|
94
93
|
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,48 +1,96 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./build" (module) {
|
|
4
|
+
module.exports = require("./build.js");
|
|
5
|
+
},
|
|
6
|
+
"./buildWatch" (module) {
|
|
7
|
+
module.exports = require("./buildWatch.js");
|
|
8
|
+
},
|
|
9
|
+
"./getFinalOption" (module) {
|
|
10
|
+
module.exports = require("./getFinalOption.js");
|
|
11
|
+
},
|
|
12
|
+
"./type" (module) {
|
|
13
|
+
module.exports = require("./type.js");
|
|
14
|
+
},
|
|
15
|
+
"./validate" (module) {
|
|
16
|
+
module.exports = require("./validate.js");
|
|
17
|
+
}
|
|
9
18
|
};
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var src_exports = {};
|
|
21
|
-
__export(src_exports, {
|
|
22
|
-
compiler: () => compiler
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(src_exports);
|
|
25
|
-
var import_build = require("./build");
|
|
26
|
-
var import_buildWatch = require("./buildWatch");
|
|
27
|
-
var import_getFinalOption = require("./getFinalOption");
|
|
28
|
-
var import_validate = require("./validate");
|
|
29
|
-
__reExport(src_exports, require("./buildWatch"), module.exports);
|
|
30
|
-
__reExport(src_exports, require("./type"), module.exports);
|
|
31
|
-
async function compiler(compilerOptions, babelOptions = {}) {
|
|
32
|
-
const validRet = (0, import_validate.validate)(compilerOptions);
|
|
33
|
-
if (validRet) {
|
|
34
|
-
return validRet;
|
|
35
|
-
}
|
|
36
|
-
const finalCompilerOption = (0, import_getFinalOption.getFinalCompilerOption)(compilerOptions);
|
|
37
|
-
if (compilerOptions.enableWatch) {
|
|
38
|
-
return (0, import_buildWatch.buildWatch)(finalCompilerOption, babelOptions);
|
|
39
|
-
} else {
|
|
40
|
-
return (0, import_build.build)(finalCompilerOption, babelOptions);
|
|
41
|
-
}
|
|
19
|
+
var __webpack_module_cache__ = {};
|
|
20
|
+
function __webpack_require__(moduleId) {
|
|
21
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
22
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
23
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
24
|
+
exports: {}
|
|
25
|
+
};
|
|
26
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
27
|
+
return module.exports;
|
|
42
28
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.n = (module)=>{
|
|
31
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
32
|
+
__webpack_require__.d(getter, {
|
|
33
|
+
a: getter
|
|
34
|
+
});
|
|
35
|
+
return getter;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
(()=>{
|
|
39
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
40
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: definition[key]
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
(()=>{
|
|
47
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
48
|
+
})();
|
|
49
|
+
(()=>{
|
|
50
|
+
__webpack_require__.r = (exports1)=>{
|
|
51
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
52
|
+
value: 'Module'
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
55
|
+
value: true
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
var __webpack_exports__ = {};
|
|
60
|
+
(()=>{
|
|
61
|
+
__webpack_require__.r(__webpack_exports__);
|
|
62
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
63
|
+
compiler: ()=>compiler
|
|
64
|
+
});
|
|
65
|
+
var _build__rspack_import_0 = __webpack_require__("./build");
|
|
66
|
+
var _buildWatch__rspack_import_1 = __webpack_require__("./buildWatch");
|
|
67
|
+
var _getFinalOption__rspack_import_2 = __webpack_require__("./getFinalOption");
|
|
68
|
+
var _validate__rspack_import_3 = __webpack_require__("./validate");
|
|
69
|
+
var __rspack_reexport = {};
|
|
70
|
+
for(const __rspack_import_key in _buildWatch__rspack_import_1)if ([
|
|
71
|
+
"default",
|
|
72
|
+
"compiler"
|
|
73
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_buildWatch__rspack_import_1[__rspack_import_key];
|
|
74
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
75
|
+
var _type__rspack_import_4 = __webpack_require__("./type");
|
|
76
|
+
var __rspack_reexport = {};
|
|
77
|
+
for(const __rspack_import_key in _type__rspack_import_4)if ([
|
|
78
|
+
"default",
|
|
79
|
+
"compiler"
|
|
80
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_type__rspack_import_4[__rspack_import_key];
|
|
81
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
82
|
+
async function compiler(compilerOptions, babelOptions = {}) {
|
|
83
|
+
const validRet = (0, _validate__rspack_import_3.validate)(compilerOptions);
|
|
84
|
+
if (validRet) return validRet;
|
|
85
|
+
const finalCompilerOption = (0, _getFinalOption__rspack_import_2.getFinalCompilerOption)(compilerOptions);
|
|
86
|
+
if (compilerOptions.enableWatch) return (0, _buildWatch__rspack_import_1.buildWatch)(finalCompilerOption, babelOptions);
|
|
87
|
+
return (0, _build__rspack_import_0.build)(finalCompilerOption, babelOptions);
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
exports.compiler = __webpack_exports__.compiler;
|
|
91
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
92
|
+
"compiler"
|
|
93
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
94
|
+
Object.defineProperty(exports, '__esModule', {
|
|
95
|
+
value: true
|
|
48
96
|
});
|
package/dist/cjs/type.js
CHANGED
|
@@ -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
|
+
});
|