beercss / beercss

Build material design interfaces in record time... without stress for devs... πŸΊπŸ’›
https://www.beercss.com
MIT License
1.35k stars 56 forks source link

Can't bundle woff files #239

Closed janat08 closed 11 months ago

janat08 commented 11 months ago

I tried rollup, parcel, and esbuild. None of them support woff imports by default. It'd be nice for install instructions to include the workaround necessary to get beercss bundled, or provide alternate install way that has woff files just linked in html.

@parcel/core: No transformers found for _nodemodules/beercss/dist/cdn/material-symbols-sharp.woff2.

leonardorafael commented 11 months ago

Fixed in v3.4.6 (https://github.com/beercss/beercss/releases/tag/v3.4.3)

You don't need to import fonts anymore, bundlers will do it automatically (updated README.md).

image

janat08 commented 10 months ago

esbuild --bundle --minify --outfile=src/assets/static/jsLibsClient.js ./src/jsLibsClient.js

X [ERROR] No loader is configured for ".woff2" files: node_modules/beercss/dist/cdn/material-symbols-sharp.woff2

import "beercss/dist/cdn/beer.min.css";
import beercss from "beercss/dist/cdn/beer.min.js";
myrp-leonardo commented 10 months ago

Have you tried the latest version v3.4.7? It will not import the .woff2 files anymore.

janat08 commented 10 months ago

I installed @latest

On Wed, Nov 29, 2023, 11:24 PM myrp-leonardo @.***> wrote:

Have you tried the latest version v3.4.7, it will not import the .woff2 files anymore.

β€” Reply to this email directly, view it on GitHub https://github.com/beercss/beercss/issues/239#issuecomment-1832381118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWP5AJTORNTPLNDXU4XDTLYG5VTZAVCNFSM6AAAAAA7MLABW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGM4DCMJRHA . You are receiving this because you authored the thread.Message ID: @.***>

myrp-leonardo commented 10 months ago

@janat08 here it works https://codesandbox.io/p/devbox/lucid-rain-4gxknv (using parcel 2)

janat08 commented 10 months ago

Parcel doesn't work for some of my other packages so I used esbuild.

On Thu, Nov 30, 2023 at 12:48β€―AM myrp-leonardo @.***> wrote:

@janat08 https://github.com/janat08 strange, this works https://codesandbox.io/p/devbox/lucid-rain-4gxknv (using parcel 2)

β€” Reply to this email directly, view it on GitHub https://github.com/beercss/beercss/issues/239#issuecomment-1832505485, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWP5APY7BHXKXM55OQNOZTYG57QVAVCNFSM6AAAAAA7MLABW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGUYDKNBYGU . You are receiving this because you were mentioned.Message ID: @.***>

janat08 commented 10 months ago

No reason that esbuild shouldn't work over not knowing what to do with woff files?

TorH2k3 commented 9 months ago

I don't get why this bug has been closed, I'm using the latest versions of beercss and material-dynamic-colors and still get the error "No loader is configured for ".woff2"" when building. "beercss": "^3.4.7" "material-dynamic-colors": "^1.1.0"

X [ERROR] No loader is configured for ".woff2" files: node_modules/beercss/dist/cdn/material-symbols-rounded.woff2

node_modules/beercss/dist/cdn/beer.min.css:1:2874:
  1 β”‚ ...splay:swap;src:url(material-symbols-rounded.woff2) format("woff2...
    β•΅                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leonardorafael commented 9 months ago

Hi, this issue was closed because this is not a bug in Beer CSS itself (after v3.4.6 when we removed the import woff files directly). Load font files inside CSS is a web standard. It seems that the bundler need some extra plugin/config to do the job. In my opinion, all bundlers should have to follow the web standards by default.

I found a possible solution here (making .woff and .woff2 files as external)? https://github.com/evanw/esbuild/issues/800

Let me know if this works for you, please.

tmutton commented 5 months ago

If, like me, you've suffered the same problem; please read this angular cli PR - https://github.com/angular/angular-cli/pull/26371 which was released as part of the 17.1.0 version.

The fix for this problem is to add the following option in your angular.json file

"loader": {
              ".woff2": "file"
            }

This should sit under architect > build > options