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
Adding a Dependency on a CSS only npm modules fails #249
Comments
I can confirm this issue. I cannot see a way to use the font-awesome npm package with the cli at the moment... |
+1 |
you can bundle the css, this works for me: {
"name": "font-awesome",
"path": "../node_modules/font-awesome/css",
"resources": ["font-awesome.css"]
} then require it: <require from="font-awesome/font-awesome.css"></require> this way font-awesome is looking for the fonts at '/fonts/fontawesome-webfont.woff2?v=4.6.3 ... ' |
I attempted this with purecss and get an error that build.js is missing.
|
@arabsight, your suggestion yields on my environment the following error during build:
|
@khenderick Yep, It does work though. Its just a workaround till some fix is provided by the CLI. here's another solution without errors: {
"name": "font-awesome",
"path": "../node_modules/font-awesome/css",
"main": "font-awesome.css"
} <require from="font-awesome.css"></require> |
You can read about how-to add font-awesome support to aurelia project from that post in stack overflow: http://stackoverflow.com/questions/39271458/how-can-i-add-font-awesome-to-my-aurelia-project-using-npm/39544587#39544587 |
This should now be fixed. |
@EisenbergEffect that's great. Is there a commit for that fix? Or some documentation, etc? |
There is. I can't remember...it was about a month back I think. |
I created a new project using cli 0.23.0 and i tried this configuration:
and it's failing at runtime, because the css try to load the font files, and they are missing. [the cli didn't bundle them] |
I didn't try to use the css file as the main entry, maybe try to use I think aurelia-cli emits only a warning if the main is not found, when using the aurelia_project entry like:
That works fine for me (I added a task for other resources like the fonts too, there is an example in another git issue) |
@avrahamcool , you can bundle font awesome manually: http://stackoverflow.com/a/39544587/1276632 |
Today (08/06/2017) I had this issue for material-elevation. Trick with empty main field stops to work.
Error message:
I run au build as pre-build task in mine .Net Core project. Version of aurelia framework: aurelia-framework@1.1.4 |
@EisenbergEffect can we reopen this? This does not appear to be fixed. The empty "main" attr does not work anymore, as noted by @szogun1987 . Also errs out during build for me -- trying to include "select2-bootstrap-theme" package:
(Tried with and without Error during build:
|
Have you tried it with main:false? |
@zewa666 , thanks for the tip; |
@hozn over at the docs in build-systems-->aurelia-cli-->adding-client-libraries-to-your-project-->a commonjs package. You might want to document this with a simple example over at our discourse forum |
@zewa666 , thanks for the link (and help). Sorry I missed that! |
I'm submitting a bug report
0.17.0
Please tell us about your environment:
Windows 10
4.2.4
3.10.5
Chrome
TypeScript 1.5.3
Current behavior:
Adding a dependency on font-awesome (CSS only) from npm fails:
At build time:
..
Tracing font-awesome...
error D:\dev\aurelia\app\node_modules\font-awesome.js
At runtime:
vendor-bundle.js:3661 Uncaught Error: Mismatched anonymous define() module:
Expected/desired behavior:
Should allow CSS file to be required successfully.
Should not throw error above
Should generate CSS resource correctly into app-bundle.js
The text was updated successfully, but these errors were encountered: