craco-purescript-loader

craco plugin to add purs-loader with create-react-app

MIT License

Downloads
11
Stars
9
Committers
2

Craco purescript-loader

This is a craco plugin to add purs-loader with create-react-app.

It allows you to use PureScript code in create-react-app without ejecting.

Installation

npm install craco-purescript-loader --save-dev
# or
yarn add -D craco-purescript-loader

Usage

const cracoPureScriptLoader = require("craco-purescript-loader");

module.exports = {
  plugins: [{ plugin: cracoPureScriptLoader }],
};

Overwrite Options

craco-purescript-loader configuration options will overwrite purs-loader options.

const cracoPureScriptLoader = require("craco-purescript-loader");

module.exports = {
  plugins: [
    {
      plugin: cracoPureScriptLoader,
      options: {
        spago: true,
        pscIde: false,
      },
    },
  ],
};

Example

Example create-react-app project with PureScript using craco and this plugin.

Alternative

An alternative to using craco is to import the PureScript compiler output directly.

Or use vite, esbuild or parcel instead of create-react-app.

Package Rankings
Top 18.1% on Npmjs.org
Badges
Extracted from project README
MIT License