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

CSS input missing from manifest.json #4198

Closed
6 tasks done
Kostia-K opened this issue Jul 9, 2021 · 5 comments
Closed
6 tasks done

CSS input missing from manifest.json #4198

Kostia-K opened this issue Jul 9, 2021 · 5 comments

Comments

@Kostia-K
Copy link

Kostia-K commented Jul 9, 2021

Describe the bug

When I specify an SCSS file as an input in rollupOptions, it get compiled correctly in dist/assets but it's missing from manifest.json.

I guess this is not a standard use case. I'm primarily using Vite to add Vue to a Django website which works great. But the website has quite a bit of SCSS which I would like to build with Vite as well.

I can make a js entrypoint file that only contains import 'style.scss' to make it appear in the manifest, but would it be possible to specify an scss input directly?

Reproduction

Don't need SCSS to reproduce, same outcome with regular CSS.

src/style.css (any non-empty CSS file)

html {
    box-sizing: border-box;
}

package.json

{
    "name": "frontend",
    "version": "0.0.0",
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "vite": "^2.4.1"
    }
}

vite.config.js

import { defineConfig } from 'vite'

export default defineConfig({
    build: {
        manifest: true,
        rollupOptions: {
            input: 'src/style.css',
        }
    }
})

npm install
npm run build

System Info

System:
    OS: Linux 5.12 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 20.01 GB / 31.36 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 16.4.2 - /usr/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 7.17.0 - /usr/bin/npm
  Browsers:
    Chromium: 91.0.4472.114
    Firefox: 89.0.2
  npmPackages:
    vite: ^2.4.1 => 2.4.1

Used Package Manager

npm

Logs

No response

Validations

@BARNZ
Copy link

BARNZ commented Jul 24, 2021

Just ran into this problem today as well.

My use case is I have 2 scss files (for light and dark themes) that I want to compile each into their own separate css files.

Using a similar vite.config to yours above:

image

I can see the 2 css files are correctly output into the assets folder:

image

But they are not included in the produced manifest.json file. So it doesn't appear I have any way to reference them externally?

@maxbublik
Copy link

I'm experiencing the same issue. Could be a duplicate of #2375

@sapphi-red
Copy link
Member

related: #6477 (comment)

@SilverMira
Copy link

found a way to have css entrypoints in manifest.json, details in gist

@bluwy
Copy link
Member

bluwy commented Jun 26, 2022

Fixed in #6649

@bluwy bluwy closed this as completed Jun 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants