Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom vue compiler options in @astrojs/vue #3143

Merged
merged 4 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding a tests for custom vue compiler options
  • Loading branch information
Tony Sullivan committed Apr 19, 2022
commit 3a554737f353d2a36c5bd23ba124f4106ec4bfdb
8 changes: 7 additions & 1 deletion packages/astro/test/fixtures/vue-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ import vue from '@astrojs/vue';

// https://astro.build/config
export default defineConfig({
integrations: [vue()],
integrations: [vue({
template: {
compilerOptions: {
isCustomElement: tag => tag.includes('my-button')
}
}
})],
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<pre>{{ value }}</pre>
<my-button>Click Me</my-button>
</template>

<script>
Expand Down
3 changes: 3 additions & 0 deletions packages/astro/test/vue-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ describe('Vue component', () => {
// test 3: all <astro-root>s have uid attributes
expect($('astro-root[uid]')).to.have.lengthOf(6);

// test 4: treats <my-button> as a custom element
expect($('my-button')).to.have.lengthOf(7);

// test 5: components with identical render output and props have been deduplicated
const uniqueRootUIDs = $('astro-root').map((i, el) => $(el).attr('uid'));
expect(new Set(uniqueRootUIDs).size).to.equal(5);
Expand Down