CLOVIS
04/08/2024, 5:13 AMandylamax
04/08/2024, 8:15 AMturansky
04/08/2024, 8:17 AMCLOVIS
04/08/2024, 8:24 AMCLOVIS
04/08/2024, 8:25 AMRobert Jaros
04/08/2024, 8:28 AMturansky
04/08/2024, 8:28 AMcommonjs
libraries?Robert Jaros
04/08/2024, 8:29 AMwasmJs
as well?CLOVIS
04/08/2024, 8:29 AMturansky
04/08/2024, 8:34 AMRequiresNpmDependencies
(like here)CLOVIS
04/08/2024, 8:35 AMcommonjs
libraries myself. I haven't done anything for wasmJs
but I believe it should just be setting the correct path for it? I'd need a project that uses it to test.CLOVIS
04/08/2024, 8:36 AMturansky
04/08/2024, 8:37 AMCLOVIS
04/08/2024, 8:38 AMRobert Jaros
04/08/2024, 8:52 AMviteBuild
? There were no errors but the vite/dist
directory contains just index.html
file and not a single js
file.CLOVIS
04/08/2024, 8:53 AM.js
file π
have you made the type="module"
change?CLOVIS
04/08/2024, 8:54 AMRobert Jaros
04/08/2024, 8:54 AM1 modules transformed
suggested the plugin did this for me πCLOVIS
04/08/2024, 8:56 AMtype=module
, it usually complains about not finding the source code. See https://opensavvy.gitlab.io/automation/kotlin-vite/api-docs/vite-kotlin/index.htmlRobert Jaros
04/08/2024, 8:57 AMCLOVIS
04/08/2024, 8:59 AMRobert Jaros
04/08/2024, 9:00 AMRobert Jaros
04/08/2024, 9:00 AMRobert Jaros
04/08/2024, 9:03 AMRobert Jaros
04/08/2024, 9:04 AMwebpack.config.d
to configure different loadersCLOVIS
04/08/2024, 9:05 AMRobert Jaros
04/08/2024, 9:05 AMCLOVIS
04/08/2024, 9:05 AMRobert Jaros
04/08/2024, 9:06 AMRobert Jaros
04/08/2024, 9:07 AMCLOVIS
04/08/2024, 9:07 AMRobert Jaros
04/08/2024, 9:07 AMvite v5.0.11 building for production...
transforming...
"img/dog.jpg" is imported by "img/dog.jpg?commonjs-external", but could not be resolved β treating it as an external dependency.
"hbs/template1.en.hbs" is imported by "hbs/template1.en.hbs?commonjs-external", but could not be resolved β treating it as an external dependency.
"hbs/template1.pl.hbs" is imported by "hbs/template1.pl.hbs?commonjs-external", but could not be resolved β treating it as an external dependency.
"img/cat.jpg" is imported by "img/cat.jpg?commonjs-external", but could not be resolved β treating it as an external dependency.
"hbs/rest.en.hbs" is imported by "hbs/rest.en.hbs?commonjs-external", but could not be resolved β treating it as an external dependency.
"hbs/rest.pl.hbs" is imported by "hbs/rest.pl.hbs?commonjs-external", but could not be resolved β treating it as an external dependency.
"i18n/messages-pl.json" is imported by "i18n/messages-pl.json?commonjs-external", but could not be resolved β treating it as an external dependency.
"i18n/messages-en.json" is imported by "i18n/messages-en.json?commonjs-external", but could not be resolved β treating it as an external dependency.
CLOVIS
04/08/2024, 9:08 AMRobert Jaros
04/08/2024, 9:10 AMconfig.resolve.modules.push("../../processedResources/js/main");
in my custom webpack config.CLOVIS
04/08/2024, 9:10 AMRobert Jaros
04/08/2024, 9:11 AMRobert Jaros
04/08/2024, 9:12 AMCLOVIS
04/08/2024, 9:12 AMCLOVIS
04/08/2024, 9:13 AMRobert Jaros
04/08/2024, 9:13 AMrequire("./file.jpg")
instead of require("file.jpg")
CLOVIS
04/08/2024, 9:13 AMCLOVIS
04/08/2024, 9:14 AMCLOVIS
04/08/2024, 9:15 AM--info
, you can see the exact command it runs and the working directoryRobert Jaros
04/08/2024, 9:16 AMRobert Jaros
04/08/2024, 9:17 AMhbs
files. Webpack uses my custom configuration for handlebars-loader
. Can I do it somehow for vite as well?CLOVIS
04/08/2024, 9:17 AMhbs
files?Robert Jaros
04/08/2024, 9:18 AMCLOVIS
04/08/2024, 9:18 AMRobert Jaros
04/08/2024, 9:19 AMCLOVIS
04/08/2024, 9:19 AMRobert Jaros
04/08/2024, 9:20 AMCLOVIS
04/08/2024, 9:20 AMRobert Jaros
04/08/2024, 9:26 AMRobert Jaros
04/08/2024, 9:26 AMβ [ERROR] "vite-plugin-handlebars" resolved to an ESM file. ESM file cannot be loaded by `require`. See <https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only> for more details. [plugin externalize-deps]
CLOVIS
04/08/2024, 9:30 AMRobert Jaros
04/08/2024, 9:30 AMCLOVIS
04/08/2024, 9:31 AMRobert Jaros
04/08/2024, 9:32 AMCLOVIS
04/08/2024, 9:33 AMRobert Jaros
04/08/2024, 9:36 AMCLOVIS
04/08/2024, 9:37 AMCLOVIS
04/08/2024, 9:37 AMRobert Jaros
04/08/2024, 9:38 AMRobert Jaros
04/08/2024, 9:38 AMRobert Jaros
04/08/2024, 9:39 AMCLOVIS
04/08/2024, 9:39 AMRobert Jaros
04/08/2024, 9:39 AMCLOVIS
04/08/2024, 9:40 AMCLOVIS
04/08/2024, 9:40 AMRobert Jaros
04/08/2024, 9:41 AMRobert Jaros
04/08/2024, 9:41 AMRobert Jaros
04/08/2024, 9:43 AMCLOVIS
04/08/2024, 9:43 AMRobert Jaros
04/08/2024, 10:17 AMRobert Jaros
04/08/2024, 10:18 AMRobert Jaros
04/08/2024, 10:19 AMRobert Jaros
04/08/2024, 10:22 AMAyfri
04/08/2024, 11:17 AMRobert Jaros
04/08/2024, 11:27 AMviteRun
task doesn't work correctly. It runs without errors but my app doesn't start. I only have an error in the browser console Uncaught SyntaxError: import not found: default
in the file generated from one of my submodules.Robert Jaros
04/08/2024, 11:32 AMRobert Jaros
04/08/2024, 11:33 AMRobert Jaros
04/08/2024, 11:36 AMRobert Jaros
04/08/2024, 11:36 AMCLOVIS
04/08/2024, 11:36 AMAyfri
04/08/2024, 11:37 AMCLOVIS
04/08/2024, 11:37 AMAyfri
04/08/2024, 11:38 AMCLOVIS
04/08/2024, 11:38 AMAyfri
04/08/2024, 11:39 AMCLOVIS
04/08/2024, 11:40 AMCLOVIS
04/08/2024, 11:42 AMRobert Jaros
04/08/2024, 12:47 PMrequire("some_module")
in K/JS I get an JS object. But the objects are sometimes different with webpack and different with vite. Unless there is some "webpack compatibility mode" in vite, it will probably never work without fixing the application (or library, which is even bigger problem).Robert Jaros
04/08/2024, 12:52 PM@JsModule
instead of require
it would probably have worked. However, for KVision, a lot of code would need to be rewritten.Robert Jaros
04/08/2024, 1:04 PMCLOVIS
04/08/2024, 1:05 PMturansky
04/08/2024, 1:05 PMcommonjs
plugin fix require
in production.turansky
04/08/2024, 1:28 PMrequire
- Webpack or Node.js function.
It's expected, that it won't work in other bundlers, which are ESM oriented from startturansky
04/08/2024, 1:29 PMprocess.env...
Robert Jaros
04/08/2024, 2:31 PMCLOVIS
04/08/2024, 2:34 PMRobert Jaros
04/08/2024, 3:28 PMbuild.gradle.kts
. I wish Kotlin team did the same for webpack configuration instead of webpack.config.d
πRobert Jaros
04/08/2024, 3:51 PMuseEsModules()
option and the dependencies problems are gone. I've successfully run dev server for an application with a dozen of different npm dependencies (with production bundle size ~ 3MB).Robert Jaros
04/08/2024, 3:52 PMRobert Jaros
04/08/2024, 3:52 PMCLOVIS
04/08/2024, 3:52 PMRobert Jaros
04/08/2024, 3:56 PMuseEsModules()
and vite with this option. Unfortunately my app doesn't work with both webpack and useEsmodules().Robert Jaros
04/08/2024, 3:57 PMCLOVIS
04/08/2024, 3:57 PMAyfri
04/08/2024, 3:57 PMuseEsModules()
in 2.0, maybe you should try in the soon-to-release RC1 ?Robert Jaros
04/08/2024, 3:58 PMCLOVIS
04/08/2024, 3:59 PMRobert Jaros
04/08/2024, 3:59 PMCLOVIS
04/08/2024, 3:59 PMAyfri
04/08/2024, 3:59 PMCLOVIS
04/08/2024, 4:00 PMRobert Jaros
04/08/2024, 4:01 PMjsRun
and wasmJsRun
, jsProductionWebpack
and wasmJsProductionWebpack
.Robert Jaros
04/08/2024, 4:02 PMjsViteRun
and wasmJsViteRun
when both targets are used.CLOVIS
04/08/2024, 4:02 PMCLOVIS
04/08/2024, 4:03 PMRobert Jaros
04/08/2024, 4:55 PMRobert Jaros
04/08/2024, 4:58 PMviteCompileDev
task is restarted, but it takes "ages" to actually compile something. Every single time it configures all modules of my project (and it's quite large). The log looks like this:
new file: /home/rjaros/git/kilua/examples/playground/src/commonMain/kotlin/main.kt~
modified: /home/rjaros/git/kilua/examples/playground/src/commonMain/kotlin/main.kt
Change detected, executing build...
> Configure project :kilua
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:bootstrap-form
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:fullstack-ktor-koin
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:hello-world
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:js-framework-benchmark
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:playground
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:resources
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-javalin
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-jooby
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-ktor
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-micronaut
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-spring-boot
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:ssr-vertx
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :examples:todomvc
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-bootstrap
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-bootstrap-icons
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-common-types
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-core-css
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-dom
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-fontawesome
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-i18n
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-imask
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-lazy-layouts
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-rest
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-routing
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-rsup-progress
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-select-remote
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-splitjs
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-ssr
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-tabulator
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-tabulator-remote
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-tempus-dominus
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-testutils
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-toastify
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-tom-select
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-tom-select-remote
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :modules:kilua-trix
New 'wasm' target is Work-in-Progress and is subject to change without notice.
> Configure project :plugins:kilua-gradle-plugin
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.9.22` that might work differently than in the requested version `1.9.23`.
> Task :examples:playground:compileKotlinJs
Robert Jaros
04/08/2024, 4:59 PMCLOVIS
04/08/2024, 4:59 PMCLOVIS
04/08/2024, 4:59 PM--continuous
, I can't do anything about itRobert Jaros
04/08/2024, 5:00 PMCLOVIS
04/08/2024, 5:00 PMRobert Jaros
04/08/2024, 5:01 PMRobert Jaros
04/08/2024, 5:03 PMviteCompileDev
is finished, the reload is not triggered immediately. The main viteRun
task need to notice the change.CLOVIS
04/08/2024, 5:04 PMRobert Jaros
04/08/2024, 5:07 PMRobert Jaros
04/08/2024, 5:08 PMRobert Jaros
04/08/2024, 5:09 PMRobert Jaros
04/08/2024, 5:09 PMCLOVIS
04/08/2024, 5:10 PMRobert Jaros
04/08/2024, 5:11 PMorg.gradle.parallel=true
org.gradle.caching=true
CLOVIS
04/08/2024, 5:12 PMRobert Jaros
04/08/2024, 5:18 PMCLOVIS
04/08/2024, 5:19 PMRobert Jaros
04/08/2024, 5:20 PMcompileKotlinJs
task.CLOVIS
04/08/2024, 5:20 PMRobert Jaros
04/08/2024, 5:21 PMRobert Jaros
04/08/2024, 5:22 PMRobert Jaros
04/08/2024, 5:23 PMAyfri
04/09/2024, 9:30 AM