Skip to content

Commit

Permalink
introduce bucklescript and reason
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoopman committed Sep 30, 2017
1 parent 1d19580 commit b22bace
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,2 +1,4 @@
node_modules
dist
dist
lib
.merlin
9 changes: 9 additions & 0 deletions bsconfig.json
@@ -0,0 +1,9 @@
{
"name": "typescript-with-bucklescript",
"version": "0.1.0",
"sources": [
"src"
],
"package-specs": ["es6"],
"bsc-flags": [ "-bs-super-errors -no-alias-deps", "-color", "always"]
}
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -9,6 +9,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"@types/node": "^8.0.31",
"bs-loader": "^1.8.0",
"bs-platform": "^1.9.3",
"source-map-loader": "^0.2.2",
"ts-loader": "^2.3.7",
"typescript": "^2.5.3",
Expand Down
2 changes: 2 additions & 0 deletions src/Bucklescript.ml
@@ -0,0 +1,2 @@
let hello name =
Js.log {j|Hi $(name), from Bucklescript.|j}
1 change: 1 addition & 0 deletions src/Reason.re
@@ -0,0 +1 @@
let hello name => Js.log {j|Hi $(name), from Reason.|j};
6 changes: 5 additions & 1 deletion src/index.ts
@@ -1 +1,5 @@
console.log("Hello from Typescript");
const helloBucklescript = require('./Bucklescript').hello;
const helloReason = require('./Reason').hello;

helloBucklescript('Typescript');
helloReason('Typescript');
11 changes: 10 additions & 1 deletion webpack.config.js
Expand Up @@ -14,7 +14,7 @@ module.exports = {
publicPath: '/dist/',
},
resolve: {
extensions: ['.js', '.ts'],
extensions: ['.js', '.ts', '.ml', '.re'],
},
module: {
rules: [
Expand All @@ -30,6 +30,15 @@ module.exports = {
loaders: ['ts-loader'],
exclude: /node_modules/
},
{
test: /\.(re|ml)$/,
use: {
loader: 'bs-loader',
options: {
module: 'es6',
}
}
},
]
}
};

0 comments on commit b22bace

Please sign in to comment.