
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Bucklescript loader for Webpack
This works with both Reason and OCaml files, thanks to Bucklescript 1.5.
npm install bs-loader
First create a bsconfig.json
for Bucklescript:
/* 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:
{
"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"
}
}
To use the loader you must:
.re
and .ml
extensions with Webpack.re
and .ml
to use the loaderAn example config would look like:
// webpack.config.js
const path = require('path')
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']
}
}
FAQs
Bucklescript integration in Webpack
We found that bs-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.