Created
September 28, 2017 13:23
-
-
Save szobov/435b4a1698c219ac757ce743c6b8c9e2 to your computer and use it in GitHub Desktop.
This file contains 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": "hello", | |
"sources": [ | |
{ | |
"dir": "src", | |
"subdirs": true | |
} | |
], | |
"bsc-flags": ["-bs-super-errors"], | |
"bs-dependencies": [ | |
"reason-react" | |
], | |
"reason": { | |
"react-jsx": 2 | |
}, | |
"package-specs": ["es6"] | |
} |
This file contains 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
type quillEditorT; | |
external quill: string => quillEditorT = "" [@@bs.module]; | |
type foo; | |
external import: string => foo = "" [@@bs.module "quill"]; | |
let inline = import "blot/inline"; | |
let editr = quill "#editor"; | |
[%bs.raw {| | |
class Foo extends inline { | |
custom_update(){ | |
console.log("BOOOM!"); | |
} | |
}; | |
Foo.tagName = 'strong'; | |
|}]; |
This file contains 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
ERROR in ./src/index.re | |
Module parse failed: ../reason-tryies/node_modules/bs-loader/index.js??ref--0-0!../reason-tryies/src/index.re Unexpected token (16:1) | |
You may need an appropriate loader to handle this file type. | |
| console.log("BOOOM!"); | |
| } | |
| }; | |
| Foo.tagName = 'strong'; | |
| )); |
This file contains 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": "reason-tryies", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "webpack", | |
"start": "webpack-dev-server", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"bs-loader": "^1.6.0", | |
"bs-platform": "^1.9.1", | |
"reason-react": "^0.2.4", | |
"webpack": "^3.5.5", | |
"webpack-dev-server": "^2.7.1" | |
}, | |
"dependencies": { | |
"quill": "^1.3.2" | |
} | |
} |
This file contains 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'); | |
module.exports = { | |
entry: './src/index.re', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
devtool: 'inline-source-map', | |
module: { | |
rules: [ | |
// Set up Reason and OCaml files to use the loader | |
{ | |
test: /\.(re|rei|ml)$/, | |
use:[ | |
{ | |
loader: 'bs-loader', | |
options: {module: 'es6'} | |
} | |
] | |
}, | |
] | |
}, | |
resolve: { | |
// Add .re and .ml to the list of extensions webpack recognizes | |
extensions: ['.re', '.rei', '.ml', '.js'] | |
}, | |
devServer: { | |
contentBase: './dist' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment