at least it works for me
# kvision
r
at least it works for me
j
when I check the created bundle.js I get some differences between the kvision minimal example and my version. In the example I find this line:
font-family: "FontAwesome"
In my bundle this line is not there
But in both I find a reference to
pl.treksoft.kvision.KVManagerFontAwesome
r
Do you have
build/js/node_modules/@fortawesome/fontawesome-free/css/all.min.css
file?
Does it work if you change ir to legacy?
j
yes - the files exist
Something is very broken here. I think the build is somehow wrong. I try to figure it out
r
You should have a js file:
build/js/packages/{PROJECT}/kotlin/{PROJECT}.js
Could you check whether there is a line:
require('@fortawesome/fontawesome-free/css/all.min.css');
in this file?
j
Yes it is
r
So it looks like a webpack problem
do you have in
webpack.conf.d
all the files from kvision template?
j
I copied them over again. Only difference: The path in webpack.js
I am very sure it is related to the fact that I include the project into my multi-module gradle project
I tried it step by step. And as soon as I integrate it, I get that "moment" error message: Can't resolve './locale' in '/home/johannes/projects/com.cedarsoft.monorepo/build/js/node_modules/moment/min'
probably something is broken related to the directory structure
I am creating a minimal project setup now
https://github.com/jschneider/kvision-minimal-multi-module-project 15f9747 - Does not build because of invalid path in webpack.js 0218418 - contains the updated webpack path. Shows the "error related to moment"
Currently I can not reproduce the fontawesome problem yet, but I will continue. --> At least the "moment.js" error message is reproduced
r
I've reproduced the error with moment locale and already fixed it. It's related to IR but should not have any impact on other things.
👍 1
j
I think I figured my problem out. It seems to be related to "moduleKind" in the kotlin js compiler configuration. I had "umd" as value. At the moment I am trying all possible values
Or maybe not 😞
Ok. It is this free compiler argument: "-Xir-property-lazy-initialization" I updated the project and added the parameter. --> This should be fixed in the near future, since this parameter will probably be the default in some future Kotlin version
7d38ca0 - is the problematic version that does not work as expected
r
If only I thought you could have this parameter set, it would save a lot of time 🙂 I'm perfectly aware it will give exactly this result.
j
Uuh. Ok.
Feel free to close the issue
I have this parameter set, because the resulting bundle size of one of our applications is a little bit smaller
r
The automatic css loading is based on eager component loading.
Without this it would not be possible to initialize css just by adding gradle dependency.
j
Ok. That makes sense
r
The alternative is to make some init() function called in code.
I'll keep this issue open for others 🙂
If you want to use this option it would probably work fine if you just put
require('@fortawesome/fontawesome-free/css/all.min.css');
directive inside your Application init block.