@dword-design/base-config-nuxt 4.0.9 → 4.0.10
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/index.js +22 -14
- package/dist/prepublish-only.js +7 -7
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -76,7 +76,10 @@ export default {
|
|
|
76
76
|
import dotenv from '@dword-design/dotenv-json-extended'
|
|
77
77
|
import jitiBabelTransform from '@dword-design/jiti-babel-transform'
|
|
78
78
|
import { transform } from '@babel/core'
|
|
79
|
-
import { babel } from '${packageName`@rollup/plugin-babel`}'
|
|
79
|
+
import { babel as rollupPluginBabel } from '${packageName`@rollup/plugin-babel`}'
|
|
80
|
+
import { parse } from 'vue/compiler-sfc'
|
|
81
|
+
import vueSfcDescriptorToString from '${packageName`vue-sfc-descriptor-to-string`}'
|
|
82
|
+
import { parseVueRequest } from '@vitejs/plugin-vue'
|
|
80
83
|
|
|
81
84
|
dotenv.config()
|
|
82
85
|
|
|
@@ -99,7 +102,7 @@ export default {
|
|
|
99
102
|
export default {
|
|
100
103
|
nitro: {
|
|
101
104
|
rollupConfig: {
|
|
102
|
-
plugins: [
|
|
105
|
+
plugins: [rollupPluginBabel({ babelHelpers: 'bundled' })],
|
|
103
106
|
},
|
|
104
107
|
},
|
|
105
108
|
modules: [
|
|
@@ -108,23 +111,28 @@ export default {
|
|
|
108
111
|
vite: {
|
|
109
112
|
plugins: [
|
|
110
113
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
enforce: 'pre',
|
|
115
|
+
transform: async (code, id) => {
|
|
116
|
+
const query = parseVueRequest(id)
|
|
117
|
+
if (query.filename.endsWith('.vue')) {
|
|
118
|
+
const sfc = parse(code)
|
|
119
|
+
if (sfc.descriptor.scriptSetup) {
|
|
120
|
+
sfc.descriptor.scriptSetup.content = await transform(sfc.descriptor.scriptSetup.content, {
|
|
121
|
+
plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
|
|
122
|
+
}).code
|
|
123
|
+
}
|
|
124
|
+
if (sfc.descriptor.script) {
|
|
125
|
+
sfc.descriptor.script.content = await transform(sfc.descriptor.script.content, {
|
|
126
|
+
plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
|
|
127
|
+
}).code
|
|
128
|
+
}
|
|
129
|
+
return vueSfcDescriptorToString(sfc.descriptor)
|
|
118
130
|
}
|
|
131
|
+
return code
|
|
119
132
|
},
|
|
120
133
|
}
|
|
121
134
|
],
|
|
122
135
|
vue: {
|
|
123
|
-
script: {
|
|
124
|
-
babelParserPlugins: [
|
|
125
|
-
['pipelineOperator', { proposal: 'fsharp' }],
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
136
|
template: {
|
|
129
137
|
transformAssetUrls: {
|
|
130
138
|
includeAbsolute: false,
|
package/dist/prepublish-only.js
CHANGED
|
@@ -10,13 +10,7 @@ export default (async (options = {}) => {
|
|
|
10
10
|
...options
|
|
11
11
|
};
|
|
12
12
|
await lint();
|
|
13
|
-
|
|
14
|
-
await fs.remove('dist');
|
|
15
|
-
await execa('babel', ['--out-dir', 'dist', '--copy-files', '--no-copy-ignored', '--ignore', '**/*.spec.js', 'model'], ...(options.log ? [{
|
|
16
|
-
stdio: 'inherit'
|
|
17
|
-
}] : []));
|
|
18
|
-
}
|
|
19
|
-
return execa(nuxtWrapper, ['build'], {
|
|
13
|
+
await execa(nuxtWrapper, ['build'], {
|
|
20
14
|
...(options.log ? {
|
|
21
15
|
stdio: 'inherit'
|
|
22
16
|
} : {}),
|
|
@@ -26,4 +20,10 @@ export default (async (options = {}) => {
|
|
|
26
20
|
}
|
|
27
21
|
} : {})
|
|
28
22
|
});
|
|
23
|
+
if (await fs.exists('model')) {
|
|
24
|
+
await fs.remove('dist');
|
|
25
|
+
await execa('babel', ['--out-dir', 'dist', '--copy-files', '--no-copy-ignored', '--ignore', '**/*.spec.js', 'model'], ...(options.log ? [{
|
|
26
|
+
stdio: 'inherit'
|
|
27
|
+
}] : []));
|
|
28
|
+
}
|
|
29
29
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-nuxt",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
4
4
|
"repository": "dword-design/base-config-nuxt",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"output-files": "^2.0.0",
|
|
47
47
|
"require-package-name": "^2.0.1",
|
|
48
48
|
"stylelint": "^13.6.0",
|
|
49
|
-
"vite-svg-loader": "^4.0.0"
|
|
49
|
+
"vite-svg-loader": "^4.0.0",
|
|
50
|
+
"vue-sfc-descriptor-to-string": "npm:@dword-design/vue-sfc-descriptor-to-string"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@dword-design/base": "^10.0.0",
|