@eggjs/core 7.0.2-beta.19 → 7.0.2-beta.20
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/loader/file_loader.js +3 -3
- package/package.json +11 -11
|
@@ -16,7 +16,7 @@ const CaseStyle = {
|
|
|
16
16
|
upper: "upper"
|
|
17
17
|
};
|
|
18
18
|
function getDefaultFileLoaderMatch() {
|
|
19
|
-
return isSupportTypeScript() ? ["**/*.(js|ts)", "!**/*.d.ts"] : ["**/*.js"];
|
|
19
|
+
return isSupportTypeScript() ? ["**/*.(js|ts|mjs|cjs)", "!**/*.d.ts"] : ["**/*.{js,mjs,cjs}"];
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Load files from directory to target object.
|
|
@@ -140,8 +140,8 @@ var FileLoader = class FileLoader {
|
|
|
140
140
|
for (const filepath of filepaths) {
|
|
141
141
|
const fullpath = path.join(directory, filepath);
|
|
142
142
|
if (!this.options.loaderFS.stat(fullpath).isFile()) continue;
|
|
143
|
-
if (filepath.endsWith(".js")) {
|
|
144
|
-
const filepathTs = filepath.replace(/\.js$/, ".ts");
|
|
143
|
+
if (filepath.endsWith(".js") || filepath.endsWith(".mjs") || filepath.endsWith(".cjs")) {
|
|
144
|
+
const filepathTs = filepath.replace(/\.(?:js|mjs|cjs)$/, ".ts");
|
|
145
145
|
if (filepaths.includes(filepathTs)) {
|
|
146
146
|
debug("[parse] ignore %s, because %s exists", fullpath, filepathTs);
|
|
147
147
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/core",
|
|
3
|
-
"version": "7.0.2-beta.
|
|
3
|
+
"version": "7.0.2-beta.20",
|
|
4
4
|
"description": "A core plugin framework based on @eggjs/koa",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"egg",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"typecheck": "tsgo --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@eggjs/extend2": "5.0.2-beta.
|
|
43
|
-
"@eggjs/koa": "3.1.2-beta.
|
|
44
|
-
"@eggjs/loader-fs": "1.0.0-beta.
|
|
45
|
-
"@eggjs/path-matching": "3.0.2-beta.
|
|
46
|
-
"@eggjs/router": "4.0.2-beta.
|
|
47
|
-
"@eggjs/typings": "4.1.2-beta.
|
|
48
|
-
"@eggjs/utils": "5.0.2-beta.
|
|
42
|
+
"@eggjs/extend2": "5.0.2-beta.20",
|
|
43
|
+
"@eggjs/koa": "3.1.2-beta.20",
|
|
44
|
+
"@eggjs/loader-fs": "1.0.0-beta.20",
|
|
45
|
+
"@eggjs/path-matching": "3.0.2-beta.20",
|
|
46
|
+
"@eggjs/router": "4.0.2-beta.20",
|
|
47
|
+
"@eggjs/typings": "4.1.2-beta.20",
|
|
48
|
+
"@eggjs/utils": "5.0.2-beta.20",
|
|
49
49
|
"egg-logger": "^3.5.0",
|
|
50
50
|
"get-ready": "^3.1.0",
|
|
51
51
|
"globby": "^11.0.2",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"utility": "^2.5.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@eggjs/mock": "7.0.2-beta.
|
|
62
|
-
"@eggjs/supertest": "9.0.2-beta.
|
|
63
|
-
"@eggjs/tsconfig": "3.1.2-beta.
|
|
61
|
+
"@eggjs/mock": "7.0.2-beta.20",
|
|
62
|
+
"@eggjs/supertest": "9.0.2-beta.20",
|
|
63
|
+
"@eggjs/tsconfig": "3.1.2-beta.20",
|
|
64
64
|
"@types/js-yaml": "^4.0.9",
|
|
65
65
|
"await-event": "2",
|
|
66
66
|
"coffee": "5",
|