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

update compiled CSS to remove the extra @charset "UTF-8" #933

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abepark01
Copy link

@abepark01 abepark01 commented Oct 16, 2021

#897 updates the source file, but not the compiled CSS.
I added the compiled CSS to piggyback on #897.

This update completes the fix for #795.
The compiled CSS still shows the following postcss warning:

Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(300:1) postcss-import: @charset must precede all other statements

@thomasbrus
Copy link

@afcapel @terreng could either one of you merge this? much appreciated

@thomasbrus
Copy link

thomasbrus commented Jan 26, 2022

This seems to fix the issue as well postcss-normalize-charset:

// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-import')({ plugins: [require('postcss-normalize-charset')] }),
    // ...
  ],
};

(specifically if you're also importing other files that have their own charset declaration, such as jQuery UI).

@mikebronner
Copy link

@thomasbrus thanks for the suggested work-around. Unfortunately this (no longer?) seems to work, as I am still getting the warning message.

My postcss.config.js:

module.exports = {
    plugins: [
        require('postcss-import')({ plugins: [require('postcss-normalize-charset')] }),
    ],
}

And the vite output:

─❯ npm run build                                                                                                                                                                                                                        ─╯

> build
> vite build

vite v3.2.7 building for production...
transforming (92) node_modules/axios/lib/helpers/parseHeaders.js
/fonts/Raleway.ttf referenced in /var/www/html/resources/css/app.css didn't resolve at build time, it will remain unchanged to be resolved at runtime

/fonts/Raleway-Italic.ttf referenced in /var/www/html/resources/css/app.css didn't resolve at build time, it will remain unchanged to be resolved at runtime
[vite:css] @charset must precede all other statements

✓ 123 modules transformed.
public/build/manifest.json             0.25 KiB
public/build/assets/app.867c71f6.css   19.51 KiB / gzip: 4.97 KiB
public/build/assets/app.b0c4883d.js    788.64 KiB / gzip: 195.57 KiB

(!) Some chunks are larger than 500 KiB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

Any thoughts why this might be?

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

Successfully merging this pull request may close these issues.

None yet

3 participants