English 中文(简体)
如何在网络服务器上部署 Kotlin Multiplatform WebAssembly 项目?
原标题:How to Deploy a Kotlin Multiplatform WebAssembly Project on a Web Server?
After building the project using JetBrains official Kotlin Multiplatform Wizard and selecting only the Web option, I tried to deploy it on the server but only encountered a white screen. What I Did Project Setup: Used the Kotlin Multiplatform Wizard, choosing the Web option. Build Commands: Ran ./gradlew wasmJsBrowserDevelopmentRun, and the site worked perfectly with the development server running on my browser Ran ./gradlew wasmJsBrowserProductionWebpack to build the production bundle. Directory Structure Post-Build: └── js ├── node_modules ├── package.json ├── packages ├── packages_imported └── yarn.lock Problem My Hosting Provider is strato.de . They provide me a SFTP access where I uploaded the whole build folder, I am then able to specifiy a "home directory" The description of home directory is as follows: In the event of an internal redirection, point your domain to a directory within your web presence. You can either enter a directory directly or click on a directory. Please ensure that a startup file is present in the selected directory (e.g., index.html, index.php). If I upload a basic index.html with some basic text, everything works fine but the index.html of this basic build is showing only a white screen. Question How can I properly deploy this Kotlin Multiplatform project to a standard web hosting environment? It should start the webpack server like it does with the ./gradlew wasmJsBrowserDevelopmentRun command, but on my Server.
问题回答
You can run: ./gradlew wasmJsBrowserDistribution Then the deployable website files will be located at: composeApp/build/dist/wasmJs/productionExecutable The files include index.html and *.wasm (among others). Instructions available at: https://kotlinlang.org/docs/wasm-get-started.html#generate-artifacts




相关问题
VS 2008 : How to publish with out DLLs?

I have developed a web application in Visual Studio 2008 and want to publish it in to the production server. I see a publish option there.But its producing files with DLL. I dont want to publish only ...

Apache: Deploying a new site to the server

I have a site currently live on a domain. I would like to switch it to a new site, that is currently in a password protected sub directory on this server. I have a "Site Maintenance in Progress" page....

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Pylons deployment questions

I m a beginner with Pylons and I ve mostly developed on my localhost using the built-in web server. I think it s time to start deployment for my personal blog, I have a Debian Lenny server with ...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

Need advice on my PHP development solution

Here is how our current php development solution is set up: Each developer work on their local machine. Each developer commit their change to a common SVN server (intranet). A commit hook upload the ...

loading from JAR files during deployment vs development

when i am loading some data into my java program, i usually use FileInputStream. however i deploy the program as a jar file and webstart, so i have to use getRessource() or getRessourceAsStream() to ...

热门标签