All Projects → nepeckman → parcel-plugin-nim

nepeckman / parcel-plugin-nim

Licence: MIT license
Nim asset for Parcel

Programming Languages

javascript
184084 projects - #8 most used programming language
nim
578 projects
HTML
75241 projects

Projects that are alternatives of or similar to parcel-plugin-nim

svelte-box
A truffle box for svelte
Stars: ✭ 60 (+185.71%)
Mutual labels:  parcel-bundler
parcel-plugin-markdown-string
📦@parcel-bundler plugin for loader markdown string, markdown output HTML.
Stars: ✭ 19 (-9.52%)
Mutual labels:  parcel-bundler
parcel-plugin-externals
Parcel plugin for declaring externals. These externals will not be bundled. 📦
Stars: ✭ 47 (+123.81%)
Mutual labels:  parcel-bundler
productive-cycles-webext
Simple-yet-complete Pomodoro timer for Firefox and Google Chrome. Built with the WebExtensions API and React.
Stars: ✭ 17 (-19.05%)
Mutual labels:  parcel-bundler
react-redux-boilerplate
A React boilerplate based on Redux, React Router, styled components and Parcel
Stars: ✭ 62 (+195.24%)
Mutual labels:  parcel-bundler
Minipack
📦 A simplified example of a modern module bundler written in JavaScript
Stars: ✭ 2,625 (+12400%)
Mutual labels:  parcel-bundler
parcel-static-template
Start a simple static site with components and hot reloading.
Stars: ✭ 20 (-4.76%)
Mutual labels:  parcel-bundler
electron-react-parcel-boilerplate
Boilerplate code to create basic, production ready Electron app using React, Parcel application bundler.
Stars: ✭ 48 (+128.57%)
Mutual labels:  parcel-bundler
parcelui
Parcel + Typescript + React/Preact + Router + CSS Modules + SASS + Jest + Api-Now + Github Actions CI
Stars: ✭ 32 (+52.38%)
Mutual labels:  parcel-bundler
hyperapp-boilerplate
Boilerplate for developing a static web app using Hyperapp built with Parcel
Stars: ✭ 17 (-19.05%)
Mutual labels:  parcel-bundler
coindesk-dashboard
Transform a nice behance.com design in HTML,CSS
Stars: ✭ 13 (-38.1%)
Mutual labels:  parcel-bundler
wordpress-starter
Timber (Twig) + Parceljs Bundler
Stars: ✭ 19 (-9.52%)
Mutual labels:  parcel-bundler
simplefolio
⚡️ A minimal portfolio template for Developers
Stars: ✭ 10,737 (+51028.57%)
Mutual labels:  parcel-bundler
ZestX-Frontend
Month-Long Fest Website ZestX with some Awsome UI and Intact Backend. Implemented admin page for user and event management
Stars: ✭ 28 (+33.33%)
Mutual labels:  parcel-bundler
preact-typescript-parcel-starter
Starter with Preact - Typescript - Parcel Bundler
Stars: ✭ 51 (+142.86%)
Mutual labels:  parcel-bundler
parcel-react-app
Create React apps using Parcel as build tool.
Stars: ✭ 12 (-42.86%)
Mutual labels:  parcel-bundler
parcel-typescript-react
📦 Typescriot react perttier example using parcel bundler
Stars: ✭ 15 (-28.57%)
Mutual labels:  parcel-bundler
react-app-boilerplate-2018
Bootstrap for a React App with Redux, React Router, Styled Components, Jest and Hot Reloading,
Stars: ✭ 20 (-4.76%)
Mutual labels:  parcel-bundler
parcel-plugin-workbox
🛠️ A plugin for Parcel to generate a service worker with Workbox.
Stars: ✭ 18 (-14.29%)
Mutual labels:  parcel-bundler

parcel-plugin-nim

Nim asset for Parcel

Installation

npm i --save-dev parcel-plugin-nim

Usage

This plugin allows Parcel to bundle Nim programs as a web asset. To use, simply install the plugin (Parcel auto loads plugins listed in package.json). When Parcel detects a Nim file in the dependencies of an asset, Parcel will run the Nim compiler (which must be installed on your computer and accessible from the path). The Nim compiler will compile the file into JavaScript, which the plugin will provide back to Parcel. Parcel will then do any relevant JavaScript transformations and bundling.

Example:

index.html:

<html>
  <body>
    <div id="root">Hello world</div>
    <script src="main.nim"></script>
  </body>
</html>

main.nim:

echo "Hello from Nim"

Then run parcel index.html or ./node_modules/.bin/parcel index.html

Tips

  1. This plugin makes it easy for a JavaScript file to import functions from Nim, as well as allowing a Nim file to import functions from JavaScript. I also wrote jsExport.nim, a macro which makes it easier to export functions from Nim to JavaScript.
  2. It is recommended to only have one Nim entry point. Nim already bundles all generated JavaScript into a single file, so multiple Nim entry points could include multiple copies of Nim standard library functions.
  3. If you run Parcel in watch mode (parcel watch ...), it will watch your web assets and auto refresh your browser when a change occurs. If you are running Nim off the devel branch (or using the nightly Nim compiler), Parcel will be able to watch all Nim files that your entry point depends on (as well as the entry point itself). If you are not using nightly Nim, only changes to the entry point will trigger a refresh.
  4. When you run Parcel in production mode (parcel build ...), this plugin will add the -d:release flag to the nim compile command.

Roadmap

This plugin is pretty simple, and doesn't need much functionality. There are some small improvements I'm considering, but I'm not sure what I will add. If there is functionality you need, feel free to raise an issue or submit a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].