0.4.2 • Published 16 days ago

vite-gleam v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

vite-gleam npm

Import from Gleam (*.gleam) files directly.

Usage

  1. npm i vite-gleam
  2. Create a basic Vite project (npm create vite)
  3. Create a gleam.toml and add Gleam dependencies
  4. Update your vite config
// vite.config.{ts,js}
import gleam from "vite-gleam";

export default {
  plugins: [gleam()],
};
  1. Start importing from Gleam!

Note

By default, TypeScript (LSP) will complain about importing files with the .gleam extension. There are two choices for fixes:

  • If the type of the import doesnt matter , add declare module "*.gleam"; inside any TypeScript file. A caveat is the LSP does not know if a export exists so it will not provide autocompletion when importing a Gleam file and it will type exports as any.
  • Alternatively, if the vite dev server is running you can have full type safety when importing from Gleam. npm i ts-gleam. Create a tsconfig.json/jsconfig.json and set compilerOptions.plugins to [{"name": "ts-gleam"}] (RECOMMENDED)
0.4.2

16 days ago

1.0.0

2 months ago

0.4.1

2 months ago

0.3.0

6 months ago

0.2.6

6 months ago

0.4.0

6 months ago

0.2.5

7 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago