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

Styles are not loaded in the Svelte example. #7

Open
michal-damiecki opened this issue May 15, 2021 · 4 comments
Open

Styles are not loaded in the Svelte example. #7

michal-damiecki opened this issue May 15, 2021 · 4 comments

Comments

@michal-damiecki
Copy link

In the Svelte example, App.svelte contains some styling, for example, button styles and so on. Unfortunately, after running build and loading extension, it works fine but it doesn't load styles.

Svelte-extension

As far as I can see styles are not included in the /dist/popup/index.html:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <link rel="icon" href="../assets/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Svelte + TS + Vite App</title>
</head>

<body style="min-width:200px;">
    <div id="app"></div>
    <script type="module" src="./main.ts"></script>
</body>

</html>
@salimldt
Copy link

salimldt commented Jul 5, 2021

Same problem

@francochau
Copy link

will the css problem be fixed?

@korzhanov
Copy link

During development, you can temporarily enable cssCodeSplit parameter in the vite.config.js

build: {
    cssCodeSplit: true
    ...
}

https://vitejs.dev/config/#build-csscodesplit
Your css will be rendered inside js

@hubingliang
Copy link

image

I tried this configuration and it worked for me !

export default defineConfig({
    plugins: [
        svelte({
          emitCss: false
        }),
       ...
    ]
});

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

No branches or pull requests

5 participants