Comparing version 1.0.0 to 1.0.1
@@ -13,3 +13,3 @@ const path = require('path') | ||
const runBsb = callback => { | ||
execFile(bsb, (err, stdout, stderr) => { | ||
execFile(bsb, ['-make-world'], (err, stdout, stderr) => { | ||
if (err) { | ||
@@ -16,0 +16,0 @@ callback(stdout, null) |
{ | ||
"name": "bs-loader", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Bucklescript integration in Webpack", | ||
@@ -9,2 +9,5 @@ "main": "index.js", | ||
}, | ||
"peerDependencies": { | ||
"bs-platform": "*" | ||
}, | ||
"repository": { | ||
@@ -11,0 +14,0 @@ "type": "git", |
# bs-loader | ||
Bucklescript loader for Webpack | ||
> Bucklescript loader for Webpack | ||
This works with both Reason and OCaml files, thanks to Bucklescript 1.5. | ||
## Installation | ||
``` | ||
npm install bs-loader | ||
``` | ||
## [Example](https://github.com/rrdelaney/bs-loader/blob/master/example) | ||
## Setting up Bucklescript | ||
First create a `bsconfig.json` for Bucklescript: | ||
```json | ||
/* bsconfig.json */ | ||
{ | ||
"name": "hello", | ||
"sources": [ | ||
"src" | ||
], | ||
"bs-dependencies": [ | ||
"reason-js", | ||
"rehydrate" | ||
], | ||
"reason": { | ||
"react-jsx": true | ||
} | ||
} | ||
``` | ||
We will also need `reason-js`, `rehydrate`, and `bs-platform`. Your `package.json` should look something like this: | ||
```json | ||
{ | ||
"name": "reason-webpack", | ||
"private": true, | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"build": "webpack" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"bs-loader": "^1.0.0", | ||
"bs-platform": "^1.5.0", | ||
"reason-js": "0.0.16", | ||
"rehydrate": "git+https://github.com/reasonml/rehydrate.git", | ||
"webpack": "^2.2.1" | ||
}, | ||
"dependencies": { | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2" | ||
} | ||
} | ||
``` | ||
## Using the loader | ||
To use the loader you must: | ||
* Register the `.re` and `.ml` extensions with Webpack | ||
* Configure `.re` and `.ml` to use the loader | ||
* Use the BucklescriptPlugin | ||
An example config would look like: | ||
```js | ||
// webpack.config.js | ||
const path = require('path') | ||
const BucklescriptPlugin = require('bs-loader/plugin') | ||
module.exports = { | ||
// Entry file can be a Reason or OCaml file | ||
entry: './src/entry.re', | ||
output: { | ||
filename: 'out.js', | ||
path: path.resolve(__dirname, 'build') | ||
}, | ||
module: { | ||
rules: [ | ||
// Set up Reason and OCaml files to use the loader | ||
{ test: /.(re|ml)$/, use: 'bs-loader' }, | ||
] | ||
}, | ||
resolve: { | ||
// Add .re and .ml to the list of extensions webpack recognizes | ||
extensions: ['.re', '.ml', '.js'] | ||
}, | ||
plugins: [ | ||
// Register the BucklescriptPlugin | ||
new BucklescriptPlugin() | ||
] | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6727
12
80
101
1
1