Skip to content

Commit

Permalink
feat: pass on compilerOptions and refSugar when using <script setup>
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 29, 2021
1 parent 65c9110 commit 7137294
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/ScriptSetup.vue
Expand Up @@ -11,10 +11,10 @@
import { ref } from 'vue'
import Button from './Button.vue'
const count = ref(0)
ref: count = 100
function inc() {
count.value++
count++
}
const hello = 'hi from scriptttt'
Expand Down
3 changes: 3 additions & 0 deletions example/webpack.config.js
Expand Up @@ -53,6 +53,9 @@ module.exports = (env = {}) => {
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
refSugar: true,
},
},
{
test: /\.png$/,
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -40,6 +40,7 @@ export interface VueLoaderOptions {
transformAssetUrls?: SFCTemplateCompileOptions['transformAssetUrls']
compiler?: TemplateCompiler | string
compilerOptions?: CompilerOptions
refSugar?: boolean
hotReload?: boolean
exposeFilename?: boolean
appendExtension?: boolean
Expand Down
4 changes: 3 additions & 1 deletion src/resolveScript.ts
Expand Up @@ -57,10 +57,12 @@ export function resolveScript(
id: scopeId,
isProd,
inlineTemplate: enableInline,
refSugar: options.refSugar,
babelParserPlugins: options.babelParserPlugins,
templateOptions: {
compiler,
ssr: isServer,
compiler,
compilerOptions: options.compilerOptions,
transformAssetUrls: options.transformAssetUrls || true,
},
})
Expand Down

0 comments on commit 7137294

Please sign in to comment.