Created
April 6, 2020 19:29
-
-
Save Kingdutch/0f32c235cc27d0e22d97408e9db04bc6 to your computer and use it in GitHub Desktop.
Most simple BSB + Webpack config possible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "@open-social/components", | |
| "reason": { | |
| "react-jsx": 3 | |
| }, | |
| "bsc-flags": ["-bs-super-errors"], | |
| "sources": [ | |
| { | |
| "dir": "src", | |
| "subdirs": true | |
| } | |
| ], | |
| "package-specs": [ | |
| { | |
| "module": "es6", | |
| "in-source": true | |
| } | |
| ], | |
| "suffix": ".bs.js", | |
| "namespace": false, | |
| "bs-dependencies": [ | |
| "reason-react" | |
| ], | |
| "ppx-flags": [], | |
| "refmt": 3 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| module.exports = { | |
| entry: './src/Index.bs.js', | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| title: 'Open Social - ReasonML', | |
| }), | |
| ], | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Namespace is false because I'm following https://dev.to/yawaramin/a-modular-ocaml-project-structure-1ikd to manually organise namespaces.
The idea is that BSB outputs ES6. Then Webpack just treats it like a normal JavaScript project.
Babel is not added yet but this could be done for polyfills and compiling down to ES5 for browsers that need it.
It looks like for now Webpack will always add its own loader stuff: webpack/webpack#2933