After running the frontendBrowserDistribution Grad...
# kvision
n
After running the frontendBrowserDistribution Gradle task the following error appears:
Module not found: Error: Can't resolve 'jquery'
Is there a Gradle task that needs to be run beforehand to install the dependencies?
r
What project/kind of project do you have? This task works fine for me on all fullstack examples.
n
Originally the project was backend only, but has been retrofitted recently to become a web full stack project: https://gitlab.com/data-conduit/conduit-server/-/tree/web-client
There isn't anything in the official documentation on adding KVision to an existing backend project. To transform it into a fullstack project.
r
You are doing everything ok. I think it's a bug in KVision. I'll investigate and let you know.
Remove
webpack.config.d/jquery.js
file and try again. Should work.
It seems our webpack ProvidePlugin configuration for jquery makes bootstrap think jQuery is available in the project. And in almost all cases it's true because all examples and generated apps have
kvision-testutils
module included, which depends on jQuery.
What a waste of bundle size for all bootstrap projects which don't need jQuery :>
I think
bootstrap-select
is currently the only component that requires the
ProvidePlugin
configuration. I'll try to workaround this issue some other way.
n
After removing the
webpack.config.d/jquery.js
file the frontend module is now building successfully without any errors 😄. Out of curiosity how much does JQuery add to the bundle size?
Now that the web client is working (via the frontend module) all attention can now turn towards getting the backend to serve up static resources. Unfortunately only the JVM version of Ktor Server can serve up static resources, however there is a hack for the Native version to do the same thing: https://kotlinlang.slack.com/archives/C0A974TJ9/p1663068956157239?thread_ts=1663033850.352749&cid=C0A974TJ9
r
jQuery added by Bootstrap because of this false assumption and not used at all is about 100KB