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

bug: vue-output-target does not load styles #345

Open
3 tasks done
mehrabix opened this issue May 23, 2023 · 1 comment
Open
3 tasks done

bug: vue-output-target does not load styles #345

mehrabix opened this issue May 23, 2023 · 1 comment
Labels

Comments

@mehrabix
Copy link

mehrabix commented May 23, 2023

Prerequisites

Stencil Version

3.0.0

Stencil Framework Output Target

Vue

Stencil Framework Output Target Version

0.8.5

Current Behavior

When i use stencil vue library in my vue-vite app, styles not loaded. when project built it creates two folder dist,lib. i try both exported components but styles not load. wonder i shoud publish lib folder or dist

Expected Behavior

I used angular-output-target it works prefectly and styles fully loaded and no problem. but have problem with loading styles in vue app

Steps to Reproduce

install my test published package:
npm i @prismaui/vue
add this scss varible in your vue global style:
https://github.com/prismaui/prismaui/blob/master/packages/core/src/global/variables.scss

and import
import {PrmButton} from '@prismaui/vue'

test

test component . it loads webcomponent but not styles

Code Reproduction URL

https://github.com/prismaui/prismaui

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label May 23, 2023
@mehrabix
Copy link
Author

mehrabix commented May 26, 2023

Hi, i found some clues,
In stencil vue integeration it mention that in order to use stenciljs component in a vue app you shoud modify main.ts like this:

// src/main.js
import { ComponentLibrary } from 'vue-library';
createApp(App).use(ComponentLibrary).mount('#app');

add your component in use() wrapper

but i test it and it does not work, instead i use this treak in stackoverflow:

// src/main.js
import { applyPolyfills, defineCustomElements } from '@prismaui/core/loader';

const app = createApp(App);

applyPolyfills().then(() => {
defineCustomElements(window);
});

it works. but in stencil vue integeration doc says you shoud do that in plugin.ts file which i did it and not work either.
what shoud i do in order to correctly load component with styles with lazy load feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant