Svelte Go Wasm Webpack screenshot

Svelte Go Wasm Webpack

Author Avatar Theme by Happybeing
Updated: 8 Nov 2020
10 Stars

Quick start template for a Golang WebAssembly app with Svelte front end

Overview

The Go WASM Template in Svelte is a quick start template that allows users to compile a Golang to WebAssembly for use with a Svelte front end. It provides a simple web app that demonstrates how all the components fit together.

Features

  • Integration of Golang with WebAssembly for front end development
  • Use of the golang-wasm-async-loader webpack plugin
  • Compatibility with Golang v1.13

Installation

To set up the Go WASM Template in Svelte, follow the steps below:

  1. Ensure you have the following pre-requisites installed:

    • Node v14.14
    • Yarn v1.22 (or npm if preferred)
  2. Clone the plugin and the template repositories. Ensure that the directories are adjacent to each other for the template to work as intended.

  3. If the directories are not adjacent, modify the path to gobridge in your main.go import accordingly.

  4. If you have node and yarn installed, you can simply copy the provided command and paste it into your terminal to install the necessary dependencies. The command will also set up the required yarn link.

Summary

The Go WASM Template in Svelte is a useful starting point for developers looking to integrate Golang with WebAssembly in their Svelte projects. The template provides a simple web app that showcases the integration and can be easily set up by following the installation guide.