Skip to content

Commit d15ec05

Browse files
committed
pass script compiler options to sfc-compiler
1 parent 6986365 commit d15ec05

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "vue-loader",
3-
"version": "17.4.2",
2+
"name": "@kamal/vue-loader",
3+
"version": "17.4.3",
44
"license": "MIT",
55
"author": "Evan You",
66
"repository": "vuejs/vue-loader",

src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,31 @@ export interface VueLoaderOptions {
5858
experimentalInlineMatchResource?: boolean
5959

6060
isServerBuild?: boolean
61+
// options to pass on to vue/compiler-sfc
62+
script?: Partial<
63+
Omit<
64+
SFCScriptCompileOptions,
65+
| 'id'
66+
| 'isProd'
67+
| 'inlineTemplate'
68+
| 'templateOptions'
69+
| 'sourceMap'
70+
| 'genDefaultAs'
71+
| 'customElement'
72+
| 'defineModel'
73+
| 'propsDestructure'
74+
>
75+
> & {
76+
/**
77+
* @deprecated defineModel is now a stable feature and always enabled if
78+
* using Vue 3.4 or above.
79+
*/
80+
defineModel?: boolean
81+
/**
82+
* @deprecated moved to `features.propsDestructure`.
83+
*/
84+
propsDestructure?: boolean
85+
}
6186
}
6287

6388
let errorEmitted = false

src/resolveScript.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export function resolveScript(
5858

5959
try {
6060
resolved = compileScript(descriptor, {
61+
...options.script,
6162
id: scopeId,
6263
isProd,
6364
inlineTemplate: enableInline,

0 commit comments

Comments
 (0)