Git Product home page Git Product logo

Comments (10)

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

please provide debug logs of svelte-windicss-preprocess, you can enable in config with

silent: false,
debug: true

also provide the version you are using of it according to the release tags of this repo. Which bundler do you use?

from svelte-windicss-preprocess.

trevyn avatar trevyn commented on June 12, 2024

Using snowpack with svelte-windicss-preprocess v3.0.0-beta.1

Where should I be looking for the logs? It doesn't show anything, and no extra files are created:

$ npm run build

> @ build /Users/eden/Desktop/turbo/frontend
> snowpack build

│
│ svelte-windicss-preprocess - v3.0.0-beta.1
│ 
│ - windicss running mode: prod
│ - advanced debug logs: on
│    • compilation mode: disabled
│    • class prefix: windi-
│    • global preflights: enabled
│    • global utilities: enabled
│
└──────────
[snowpack] ! building source files...
[snowpack] ✔ build complete [1.73s]
[snowpack] ! building dependencies...
[snowpack] ✔ dependencies ready! [4.50s]
[snowpack] ! verifying build...
[snowpack] ✔ verification complete [0.01s]
[snowpack] ! writing build to disk...
[snowpack] ! optimizing build...
[snowpack] ✔ optimize complete [0.35s]
[snowpack] ▶ Build Complete!

from svelte-windicss-preprocess.

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

thanks, that was all I was looking for. Can you try to delete globalPreflights & globalUtilities from your preprocess config. Also are the styles duplicated in one css or are they existing in multiple files? Can you reproduce with the snowpack example project in this repo?

from svelte-windicss-preprocess.

trevyn avatar trevyn commented on June 12, 2024

Same result after deleting globalPreflights & globalUtilities. Styles are duplicated in one output css file, and it also happens when running in dev mode.

Will try to reproduce with example project now.

from svelte-windicss-preprocess.

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

Ok, i asked you to reproduce with example project so I can test it myself. If that does not work, please put your project with this behavior on github, so I can clone and check :)

from svelte-windicss-preprocess.

trevyn avatar trevyn commented on June 12, 2024

Ahhh, I think I see what's happening. I want a single .css file output, so I'm using

 optimize: {
  bundle: true,
 },

in the snowpack.config.js, and I guess it's just running each Svelte component separately and then gluing all the CSS together. So I guess the best option is for me to figure out how to de-dupe the result...

Project is in the frontend directory of trevyn/turbo.

from svelte-windicss-preprocess.

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

Svelte windicss preprocess has a hidden bundle config in v2, you can check if that works. V3 will support this too? Just not in beta 1

bundle: FILEPATH

from svelte-windicss-preprocess.

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

Also svelte does de-dedup by default. So it might be snowpack problem here. I will check your project later tonight

from svelte-windicss-preprocess.

noahsalvi avatar noahsalvi commented on June 12, 2024

I also get this problem with rollup.

│ svelte-windicss-preprocess - v3.0.0-beta.3
│ NODE_ENV is undefined
│ - windicss running mode: prod
│ - advanced debug logs: on
│    • compilation mode: disabled
│    • class prefix: windi-
│    • global preflights: enabled
│    • global utilities: disabled

For every component in my app, there is a duplicate of windicss reset.

REPO:

  1. Install official svelte template
  2. Add svelte-windicss-preprocess
  3. Add to rollup
  4. Create a new component with tailwind classes
  5. Import into the app component.
  6. build the project
  7. Check bundle.css

from svelte-windicss-preprocess.

alexanderniebuhr avatar alexanderniebuhr commented on June 12, 2024

this should be fixed for bundlers which do not parsing svelte files in parallel. snowpack is known for doing it, so it will genereate mutliple css files. while rollup seems to generate one main css

from svelte-windicss-preprocess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.