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

plugin breakes font imports build #26

Open
NookieGrey opened this issue Jan 12, 2020 · 2 comments
Open

plugin breakes font imports build #26

NookieGrey opened this issue Jan 12, 2020 · 2 comments

Comments

@NookieGrey
Copy link

After adding plugin getting such error, only in build, development works well

./src/assets/styles/index.less
ModuleNotFoundError: Module not found: Error: Can't resolve './font/Museo/Museo-300.eot' in 'C:\Users\gagul\WebstormProjects\vsbl\src\assets\styles'

assets/styles/index.less
@import "./fonts/index.less";

assets/styles/fonts/index.less
@import "./Museo.less";

assets/styles/fonts/Museo.less

@font-face {
    font-family: 'Museo';
    src: url('../../font/Museo/Museo-300.eot');
    src: url('../../font/Museo/Museo-300.eot?#iefix') format('embedded-opentype'),
    url('../../font/Museo/Museo-300.woff2') format('woff2'),
    url('../../font/Museo/Museo-300.woff') format('woff'),
    url('../../font/Museo/Museo-300.ttf')  format('truetype'),
    url('../../font/Museo/Museo-300.svg#Museo-300') format('svg');
}

all fonts are stored in assets/font

without plugin works great

@NookieGrey
Copy link
Author

So this is min repro error
https://github.com/NookieGrey/craco-antd-font
try to build this app

@alistairjcbrown
Copy link

alistairjcbrown commented Jun 8, 2020

Looking at your repo linked above, you're using .less files in a Create React App build, which CRA doesn't support natively. Renaming them to .css solves the issue in your minimal repo, though I assume in your actual repository you're making use of Less styles?

Otherwise, looks like this may be related to an issue in the underlying craco-less plugin - DocSpring/craco-less#38

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

No branches or pull requests

2 participants