@dword-design/base-config-nuxt 4.0.12 → 4.0.13

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -116,15 +116,12 @@ export default {
116
116
  const query = parseVueRequest(id)
117
117
  if (query.filename.endsWith('.vue')) {
118
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
119
+ for (const section of ['scriptSetup', 'script']) {
120
+ if (sfc.descriptor[section] && sfc.descriptor[section].lang === undefined) {
121
+ sfc.descriptor[section].content = await transform(sfc.descriptor[section].content, {
122
+ plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
123
+ }).code
124
+ }
128
125
  }
129
126
  return vueSfcDescriptorToString(sfc.descriptor)
130
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",