0.4.3 • Published 1 year ago

vite-gleam v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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 doesn't matter , add declare module "*.gleam"; inside any TypeScript file. A caveat is the LSP does not know if an 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.3

1 year ago

0.4.2

1 year ago

1.0.0

1 year ago

0.4.1

1 year ago

0.3.0

2 years ago

0.2.6

2 years ago

0.4.0

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago