svelte-preprocess-nim Svelte Themes

Svelte Preprocess Nim

NOT PUBLISHED YET!

svelte-preprocess-nim

A Svelte Preprocessor to compile nim

Install

$ npm install -D svelte-preprocess-nim

Usage

Preprocessors

Example: svelte.config.js

// svelte.config.js
const sveltePreprocess = require("svelte-preprocess");
const { transformSync } = require("svelte-preprocess-nim");

module.exports = {
  preprocess: sveltePreprocess({
    nim({ content, filename, attributes }) {
      const { code } = transformSync(content, {});
      return { code };
    },
  }),
};

.svelte files

// App.svelte
<script src="./App.nim">
</script>

<div class="App" />

<style>
</style>

OR

// App.svelte
<script lang="nim">
import std/jsconsole

console.log("Hello, nim!")
</script>

<div class="App" />

<style>
</style>

NOTES: To use the editor's language support, you need to select the former.

License

MIT © NaokiM03

Top categories

Loading Svelte Themes