@dword-design/base-config-nuxt 3.2.1 → 3.2.3
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.
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import babelConfig from '@dword-design/babel-config';
|
|
1
2
|
import join from "@dword-design/functions/dist/join.js";
|
|
2
3
|
import keys from "@dword-design/functions/dist/keys.js";
|
|
3
4
|
import map from "@dword-design/functions/dist/map.js";
|
|
4
5
|
import omit from "@dword-design/functions/dist/omit.js";
|
|
5
6
|
import packageName from 'depcheck-package-name';
|
|
7
|
+
import jiti from 'jiti';
|
|
6
8
|
import { createRequire } from 'module';
|
|
7
9
|
import nuxtPushPlugins from 'nuxt-push-plugins';
|
|
8
10
|
import P from 'path';
|
|
9
11
|
import sequential from 'promise-sequential';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
12
|
import axiosDynamicBaseurlModule from "./modules/axios-dynamic-baseurl/index.js";
|
|
12
13
|
import babelModule from "./modules/babel.js";
|
|
13
14
|
import bodyParserModule from "./modules/body-parser.js";
|
|
@@ -34,11 +35,17 @@ export default async function () {
|
|
|
34
35
|
userScalable: true
|
|
35
36
|
};
|
|
36
37
|
let localConfig;
|
|
37
|
-
const configPath = P.join(this.options.rootDir, 'nuxt.config.js');
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
const jitiInstance = jiti(this.options.rootDir, {
|
|
40
|
+
esmResolve: true,
|
|
41
|
+
interopDefault: true,
|
|
42
|
+
transformOptions: {
|
|
43
|
+
babel: babelConfig
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
localConfig = jitiInstance('./nuxt.config.js');
|
|
40
47
|
} catch (error) {
|
|
41
|
-
if (error.message
|
|
48
|
+
if (error.message.startsWith("Cannot find module './nuxt.config.js'\n")) {
|
|
42
49
|
localConfig = {};
|
|
43
50
|
} else {
|
|
44
51
|
throw error;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import babelConfig from '@dword-design/babel-config';
|
|
1
2
|
import express from 'express';
|
|
2
3
|
import mountFiles from 'express-mount-files';
|
|
3
4
|
import P from 'path';
|
|
4
|
-
export default
|
|
5
|
+
export default function (options) {
|
|
5
6
|
const app = options.expressInstance || express();
|
|
6
|
-
app.use(
|
|
7
|
+
app.use(mountFiles(P.join(this.options.srcDir, 'api'), {
|
|
8
|
+
jitiOptions: {
|
|
9
|
+
esmResolve: true,
|
|
10
|
+
interopDefault: true,
|
|
11
|
+
transformOptions: {
|
|
12
|
+
babel: babelConfig
|
|
13
|
+
}
|
|
14
|
+
},
|
|
7
15
|
paramChar: '_'
|
|
8
16
|
}));
|
|
9
17
|
this.addServerMiddleware({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-nuxt",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"repository": "dword-design/base-config-nuxt",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/core": "^7.16.0",
|
|
26
26
|
"@babel/traverse": "^7.16.3",
|
|
27
|
+
"@dword-design/babel-config": "^2.1.1",
|
|
27
28
|
"@dword-design/depcheck-parser-sass": "^3.0.0",
|
|
28
29
|
"@dword-design/dotenv-json-extended": "^2.0.0",
|
|
29
30
|
"@dword-design/eslint-config": "^3.0.1",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"express-mount-files": "npm:@dword-design/express-mount-files",
|
|
41
42
|
"fs-extra": "^10.0.0",
|
|
42
43
|
"globby": "^11.0.1",
|
|
44
|
+
"jiti": "^1.16.0",
|
|
43
45
|
"nuxt": "~2.15.0",
|
|
44
46
|
"nuxt-babel-runtime": "^3.0.0",
|
|
45
47
|
"nuxt-basic-auth-module": "^1.4.1",
|