@modern-js/babel-compiler 2.17.1 → 2.18.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/CHANGELOG.md +6 -0
- package/dist/esm/build.js +10 -10
- package/dist/esm/buildWatch.js +2 -2
- package/dist/esm/compiler.js +10 -10
- package/dist/esm/compilerErrorResult.js +1 -1
- package/dist/esm/defaults.js +1 -1
- package/dist/esm/getFinalOption.js +6 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/esm/build.js
CHANGED
|
@@ -163,21 +163,21 @@ export var build = function() {
|
|
|
163
163
|
filename = _step.value;
|
|
164
164
|
try {
|
|
165
165
|
dist = compiler({
|
|
166
|
-
rootDir,
|
|
167
|
-
enableVirtualDist,
|
|
166
|
+
rootDir: rootDir,
|
|
167
|
+
enableVirtualDist: enableVirtualDist,
|
|
168
168
|
filepath: filename,
|
|
169
|
-
distDir,
|
|
170
|
-
verbose,
|
|
171
|
-
quiet,
|
|
172
|
-
babelConfig,
|
|
173
|
-
distFileExtMap
|
|
169
|
+
distDir: distDir,
|
|
170
|
+
verbose: verbose,
|
|
171
|
+
quiet: quiet,
|
|
172
|
+
babelConfig: babelConfig,
|
|
173
|
+
distFileExtMap: distFileExtMap
|
|
174
174
|
});
|
|
175
175
|
if (enableVirtualDist && dist) {
|
|
176
176
|
virtualDists.push(dist);
|
|
177
177
|
}
|
|
178
178
|
} catch (e) {
|
|
179
179
|
messageDetails.push({
|
|
180
|
-
filename,
|
|
180
|
+
filename: filename,
|
|
181
181
|
content: e.toString()
|
|
182
182
|
});
|
|
183
183
|
}
|
|
@@ -210,7 +210,7 @@ export var build = function() {
|
|
|
210
210
|
{
|
|
211
211
|
code: 1,
|
|
212
212
|
message: "Compilation failure ".concat(messageDetails.length, " ").concat(messageDetails.length !== 1 ? "files" : "file", " with Babel."),
|
|
213
|
-
messageDetails
|
|
213
|
+
messageDetails: messageDetails
|
|
214
214
|
}
|
|
215
215
|
];
|
|
216
216
|
}
|
|
@@ -219,7 +219,7 @@ export var build = function() {
|
|
|
219
219
|
{
|
|
220
220
|
code: 0,
|
|
221
221
|
message: "Successfully compiled ".concat(filenames.length, " ").concat(filenames.length !== 1 ? "files" : "file", " with Babel."),
|
|
222
|
-
virtualDists
|
|
222
|
+
virtualDists: virtualDists
|
|
223
223
|
}
|
|
224
224
|
];
|
|
225
225
|
}
|
package/dist/esm/buildWatch.js
CHANGED
|
@@ -58,7 +58,7 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
58
58
|
function _define_property(obj, key, value) {
|
|
59
59
|
if (key in obj) {
|
|
60
60
|
Object.defineProperty(obj, key, {
|
|
61
|
-
value,
|
|
61
|
+
value: value,
|
|
62
62
|
enumerable: true,
|
|
63
63
|
configurable: true,
|
|
64
64
|
writable: true
|
|
@@ -370,7 +370,7 @@ export var runBuildWatch = function() {
|
|
|
370
370
|
result = {
|
|
371
371
|
code: 0,
|
|
372
372
|
message: "remove file: ".concat(removeFiles.join(",")),
|
|
373
|
-
removeFiles
|
|
373
|
+
removeFiles: removeFiles
|
|
374
374
|
};
|
|
375
375
|
emitter.emit(BuildWatchEvent.watchingCompiler, result);
|
|
376
376
|
return [
|
package/dist/esm/compiler.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _define_property(obj, key, value) {
|
|
2
2
|
if (key in obj) {
|
|
3
3
|
Object.defineProperty(obj, key, {
|
|
4
|
-
value,
|
|
4
|
+
value: value,
|
|
5
5
|
enumerable: true,
|
|
6
6
|
configurable: true,
|
|
7
7
|
writable: true
|
|
@@ -93,9 +93,9 @@ export var compiler = function(option) {
|
|
|
93
93
|
throw new Error("".concat(filepath, " happen error"));
|
|
94
94
|
}
|
|
95
95
|
var distFilePath = getDistFilePath({
|
|
96
|
-
filepath,
|
|
97
|
-
rootDir,
|
|
98
|
-
distDir,
|
|
96
|
+
filepath: filepath,
|
|
97
|
+
rootDir: rootDir,
|
|
98
|
+
distDir: distDir,
|
|
99
99
|
extMap: distFileExtMap
|
|
100
100
|
});
|
|
101
101
|
if (enableVirtualDist) {
|
|
@@ -109,17 +109,17 @@ export var compiler = function(option) {
|
|
|
109
109
|
if ((babelRes === null || babelRes === void 0 ? void 0 : babelRes.map) && babelConfig.sourceMaps && babelConfig.sourceMaps !== "inline") {
|
|
110
110
|
if (virtualDist) {
|
|
111
111
|
virtualDist = _object_spread({}, virtualDist, resolveSourceMap({
|
|
112
|
-
babelRes,
|
|
112
|
+
babelRes: babelRes,
|
|
113
113
|
sourceFilePath: filepath,
|
|
114
|
-
distFilePath,
|
|
115
|
-
enableVirtualDist
|
|
114
|
+
distFilePath: distFilePath,
|
|
115
|
+
enableVirtualDist: enableVirtualDist
|
|
116
116
|
}));
|
|
117
117
|
} else {
|
|
118
118
|
resolveSourceMap({
|
|
119
|
-
babelRes,
|
|
119
|
+
babelRes: babelRes,
|
|
120
120
|
sourceFilePath: filepath,
|
|
121
|
-
distFilePath,
|
|
122
|
-
enableVirtualDist
|
|
121
|
+
distFilePath: distFilePath,
|
|
122
|
+
enableVirtualDist: enableVirtualDist
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
}
|
package/dist/esm/defaults.js
CHANGED
|
@@ -12,7 +12,7 @@ function _array_without_holes(arr) {
|
|
|
12
12
|
function _define_property(obj, key, value) {
|
|
13
13
|
if (key in obj) {
|
|
14
14
|
Object.defineProperty(obj, key, {
|
|
15
|
-
value,
|
|
15
|
+
value: value,
|
|
16
16
|
enumerable: true,
|
|
17
17
|
configurable: true,
|
|
18
18
|
writable: true
|
|
@@ -116,7 +116,7 @@ export var getFilesFromDir = function(param) {
|
|
|
116
116
|
var globFindFilenames = [];
|
|
117
117
|
var globPattern = getGlobPattern(dir, finalExt);
|
|
118
118
|
globFindFilenames = glob.sync(globPattern, {
|
|
119
|
-
ignore
|
|
119
|
+
ignore: ignore
|
|
120
120
|
});
|
|
121
121
|
return globFindFilenames;
|
|
122
122
|
};
|
|
@@ -128,15 +128,15 @@ export var getFinalCompilerOption = function(option) {
|
|
|
128
128
|
if (sourceDir) {
|
|
129
129
|
globFindFilenames = getFilesFromDir({
|
|
130
130
|
dir: sourceDir,
|
|
131
|
-
ignore,
|
|
132
|
-
finalExt
|
|
131
|
+
ignore: ignore,
|
|
132
|
+
finalExt: finalExt
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
if (enableWatch) {
|
|
136
136
|
globFindFilenames = getFilesFromDir({
|
|
137
137
|
dir: watchDir,
|
|
138
|
-
ignore,
|
|
139
|
-
finalExt
|
|
138
|
+
ignore: ignore,
|
|
139
|
+
finalExt: finalExt
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
return _object_spread_props(_object_spread({}, optionWithDefault), {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.18.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/core": "^7.18.0",
|
|
35
35
|
"@babel/runtime": "^7.18.0",
|
|
36
|
-
"@modern-js/utils": "2.
|
|
36
|
+
"@modern-js/utils": "2.18.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/plugin-transform-classes": "^7.18.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@types/node": "^14",
|
|
45
45
|
"typescript": "^4",
|
|
46
46
|
"jest": "^29",
|
|
47
|
-
"@scripts/build": "2.
|
|
48
|
-
"@scripts/jest-config": "2.
|
|
47
|
+
"@scripts/build": "2.18.0",
|
|
48
|
+
"@scripts/jest-config": "2.18.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"modernConfig": {
|