Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pocka/rollup-plugin-gleam

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pocka/rollup-plugin-gleam

Rollup plugin for Gleam language.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
0
Weekly downloads
 
Created
Source

rollup-plugin-gleam

A Rollup plugin that add supports for Gleam language. Also compatible with Vite.

Requirements

This plugin requires Rollup >= v1.12.0 and a working Gleam executable (gleam).

Usage

Import the plugin in your rollup.config.js or vite.config.js:

import { gleam } from "@pocka/rollup-plugin-gleam";

export default {
	// ...
	plugins: [gleam()],
};

Then you can import .gleam files:

// hello.gleam
pub fn hello(name: String) -> String {
  "Hello, " <> name
}
import { hello } from "./hello.gleam";

console.log(hello("World"));

Options

gleamToml

  • Type: URL or String
  • Default: "./gleam.toml"

File path or file URL to gleam.toml. If the value is relative path string, this plugin resolves the path from current working directory.

gleam({
	gleamToml: new URL("./gleam.toml", import.meta.url),
});

bin

  • Type: String
  • Default: "gleam"

Binary name or path to Gleam executable file. This plugin builds Gleam file using this value.

gleam({
	bin: "/path/to/gleam",
});
// > /path/to/gleam build --target javascript

buildOptions.warningAsErrors

  • Type: Boolean
  • Default: false

This option activates --warning-as-errors compiler flag. If this option is enabled, warning made by Gleam compiler will be treated as a build error.

gleam({
	buildOptions: {
		warningAsErrors: true,
	},
});
// This won't compile with the flag on, due to an unused variable warning.
pub fn hello(name: String) -> String {
  "Hello World!"
}

License

This software is licensed under Apache License Version 2.0.

This project adheres to REUSE Specification. Every checked-in file has copyright and license information inside a comment header, adjacent *.license file, or REUSE.toml file.

Keywords

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc