Skip to content

Commit

Permalink
fix(plugin-vue): pass on script and style options to compiler-sfc
Browse files Browse the repository at this point in the history
fix #1450
  • Loading branch information
yyx990803 committed Jan 9, 2021
1 parent d7ceabe commit 0503d42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/plugin-vue/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function resolveScript(
let resolved: SFCScriptBlock | null = null

resolved = compileScript(descriptor, {
...options.script,
id: descriptor.id,
isProd: options.isProduction,
inlineTemplate: !options.devServer,
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-vue/src/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function transformStyle(
// vite already handles pre-processors and CSS module so this is only
// applying SFC-specific transforms like scoped mode and CSS vars rewrite (v-bind(var))
const result = await compileStyleAsync({
...options.style,
filename: descriptor.filename,
id: `data-v-${descriptor.id}`,
isProd: options.isProduction,
Expand Down

2 comments on commit 0503d42

@lmiller1990
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still no luck @yyx990803 (I could be in the wrong) for both usage in <template> and <script>.

I can take a look into this. Maybe we can reopen #1450 in the meantime.

@yyx990803
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmiller1990 add a reproduction with beta.16 to #1450 and I can reopen it

Please sign in to comment.