Giter Club home page Giter Club logo

Comments (7)

jd-solanki avatar jd-solanki commented on June 19, 2024

It might be upstream issue: unocss/unocss#2938

from anu.

yooneskh avatar yooneskh commented on June 19, 2024

This is resolved in the upstream now. It was related to Nuxt. Removing the lock file so the package manager would get the latest packages will fix the issues.

An unrelated question, do you know if Unocss or Nuxt can generate only the necessary css for each page?
So the css code for Btn (for example) which is not used in the current page but is used in the other pages will not be loaded?

from anu.

jd-solanki avatar jd-solanki commented on June 19, 2024

Unocss or Nuxt can generate only the necessary css for each page

Yes, #197

When btn will be used for the first time, UnoCSS will only load the style at that time

If you don't get this behavior let me know.

from anu.

yooneskh avatar yooneskh commented on June 19, 2024

Ok so i made a barebones project to test this. You can find it here.
https://github.com/yooneskh/repro-anu-nuxt
(It is different than the one above)

It is basically these files.

// nuxt.config.js

export default defineNuxtConfig({
  vue: {
    defineModel: true,
  },
  modules: [
    '@anu-vue/nuxt',
    '@unocss/nuxt',
  ],
});


// uno.config.js

import { defineConfig } from 'unocss';

export default defineConfig({
  include: [
    /.*\/anu-vue\.js(.*)?$/,
    './**/*.vue',
    './**/*.md',
  ],
});
// app.vue

<script setup>

</script>

<template>
  <nuxt-page />
</template>


// pages/index.vue

<script setup>

</script>

<template>
  <p>Hello</p>
</template>

You can view it live here
https://repro-anu-nuxt.vercel.app/

The important issue is that both the styles and the js bundle for all components are loaded. You can view its source, but basically, in this js bundle https://repro-anu-nuxt.vercel.app/_nuxt/entry.6f577059.js you can find all components (try searching for "ABtn" and "AList" and so on), and in this css bundle https://repro-anu-nuxt.vercel.app/_nuxt/entry.de0e007d.css you can find styles for all components.

Note that this happens while nothing is used.

Do you have any idea on what's wrong?

from anu.

yooneskh avatar yooneskh commented on June 19, 2024

Hi there @jd-solanki
sorry to ping you, did you have the time to look at this?

from anu.

jd-solanki avatar jd-solanki commented on June 19, 2024

Sorry @yooneskh I was on holidays was busy with other things lately. I'm planning to move to Python community in near future. However, I'll try to resolve this issue and pending issue for sure πŸ‘πŸ»

Maybe in next two week I'll be able to resolve this.

Thanks for your interest. Would like to contribute to this? We can move this repo to org for others to contribute.

from anu.

yooneskh avatar yooneskh commented on June 19, 2024

@jd-solanki oh happy holidays!

Sure i will love to contribute. I have lots of ideas to improve anu.

from anu.

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.