https://github.com/andys8/craco-purescript-loader
craco plugin to add purs-loader with create-react-app
https://github.com/andys8/craco-purescript-loader
craco create-react-app purescript purs-loader react
Last synced: 12 months ago
JSON representation
craco plugin to add purs-loader with create-react-app
- Host: GitHub
- URL: https://github.com/andys8/craco-purescript-loader
- Owner: andys8
- License: mit
- Created: 2020-08-07T10:38:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T12:39:15.000Z (over 3 years ago)
- Last Synced: 2025-05-12T03:45:48.908Z (about 1 year ago)
- Topics: craco, create-react-app, purescript, purs-loader, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/craco-purescript-loader
- Size: 2.11 MB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Craco purescript-loader
[](LICENSE)
This is a [craco](https://github.com/gsoft-inc/craco) plugin to add [purs-loader](https://www.npmjs.com/package/purs-loader) with [`create-react-app`](https://facebook.github.io/create-react-app).
It allows you to use [PureScript](https://www.purescript.org) code in `create-react-app` without ejecting.
## Installation
```bash
npm install craco-purescript-loader --save-dev
# or
yarn add -D craco-purescript-loader
```
## Usage
```js
const cracoPureScriptLoader = require("craco-purescript-loader");
module.exports = {
plugins: [{ plugin: cracoPureScriptLoader }],
};
```
### Overwrite Options
`craco-purescript-loader` configuration `options` will overwrite [`purs-loader` options](https://www.npmjs.com/package/purs-loader#options).
```js
const cracoPureScriptLoader = require("craco-purescript-loader");
module.exports = {
plugins: [
{
plugin: cracoPureScriptLoader,
options: {
spago: true,
pscIde: false,
},
},
],
};
```
## Example
[Example `create-react-app` project with PureScript](https://github.com/andys8/create-react-app-purescript) using `craco` and this plugin.
## Alternative
An alternative to using craco is to [import the PureScript compiler output directly](https://github.com/purescript/spago/#get-started-from-scratch-with-webpack-frontend-projects).
Or use vite, esbuild or parcel instead of create-react-app.