@dword-design/base-config-nuxt 5.0.6 → 5.0.7

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.
@@ -6,7 +6,6 @@ import packageName from 'depcheck-package-name';
6
6
  import vitePluginBabel from 'vite-plugin-babel';
7
7
  import vueSfcDescriptorToString from 'vue-sfc-descriptor-to-string';
8
8
  import config from "./config.js";
9
- // import expressModule from './modules/express/index.js'
10
9
  import i18nModule from "./modules/i18n.js";
11
10
  import localeLinkModule from "./modules/locale-link/index.js";
12
11
  import svgModule from "./modules/svg.js";
@@ -78,7 +77,7 @@ export default {
78
77
  enforce: 'pre',
79
78
  transform: async (code, id) => {
80
79
  const query = parseVueRequest(id);
81
- if (query.filename.endsWith('.vue') && !query.filename.split('/').includes('node_modules')) {
80
+ if (query.filename.endsWith('.vue') && query.query.type !== 'style' && !query.filename.split('/').includes('node_modules')) {
82
81
  const sfc = parse(code);
83
82
  for (const section of ['scriptSetup', 'script']) {
84
83
  if (sfc.descriptor[section] && sfc.descriptor[section].lang === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -43,13 +43,10 @@
43
43
  "depcheck-package-name": "^3.0.0",
44
44
  "depcheck-parser-vue": "^4.0.7",
45
45
  "execa": "^7.1.1",
46
- "express": "^4.17.1",
47
- "express-mount-files": "npm:@dword-design/express-mount-files",
48
46
  "fs-extra": "^11.1.0",
49
47
  "globby": "^13.1.3",
50
48
  "jiti": "^1.18.2",
51
49
  "nuxt": "^3.2.3",
52
- "nuxt-alias-path": "^1.0.0",
53
50
  "nuxt-basic-authentication-module": "^0.2.1",
54
51
  "output-files": "^2.0.0",
55
52
  "require-package-name": "^2.0.1",
@@ -1,29 +0,0 @@
1
- import jitiBabelTransform from '@dword-design/jiti-babel-transform';
2
- import express from 'express';
3
- import mountFiles from 'express-mount-files';
4
- import { fromNodeMiddleware } from 'h3';
5
- import jiti from 'jiti';
6
- import P from 'path';
7
- import options from '#express/options.js';
8
- const jitiOptions = {
9
- esmResolve: true,
10
- interopDefault: true,
11
- transform: jitiBabelTransform
12
- };
13
- const jitiInstance = jiti(options.srcDir, jitiOptions);
14
- let app = express().use(express.json()).use(express.urlencoded({
15
- extended: false
16
- }));
17
- try {
18
- const setupExpress = jitiInstance('./setup-express');
19
- app = setupExpress(app);
20
- } catch (error) {
21
- if (!error.message.startsWith("Cannot find module './setup-express'")) {
22
- throw error;
23
- }
24
- }
25
- app.use('/api', mountFiles(P.resolve(options.srcDir, 'api'), {
26
- jitiOptions,
27
- paramChar: '_'
28
- }));
29
- export default fromNodeMiddleware(app);
@@ -1,18 +0,0 @@
1
- import { addServerHandler, addTemplate, createResolver } from '@nuxt/kit';
2
- import nuxtAliasPath from 'nuxt-alias-path';
3
- import P from 'path';
4
- const resolver = createResolver(import.meta.url);
5
- const moduleName = 'express';
6
- export default ((options, nuxt) => {
7
- addTemplate({
8
- filename: P.join(moduleName, 'options.js'),
9
- getContents: () => `export default ${JSON.stringify({
10
- srcDir: nuxt.options.srcDir
11
- }, undefined, 2)}`,
12
- write: true
13
- });
14
- nuxt.options.alias[`#${moduleName}`] = nuxtAliasPath(moduleName, nuxt);
15
- addServerHandler({
16
- handler: resolver.resolve('./handler')
17
- });
18
- });