{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true
}
}
- Create
main.ts
typescript file for entry point
// Our bootstrap code
alert('Ok!!');
module.exports = {
entry: "./main", // input typescript file
output: { filename: "app.js" }, // output javascript file
module: {
loaders: [
{
test: /.ts$/,
loader: "ts-loader"
}
]
},
resolve: {
extensions: [".ts", ".js"]
}
}
- Create
index.html
that uses app.js
output script file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello RxJS</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>
- Update
package.json
to add some npm script
{
// ...
"scripts": {
"start": "webpack-dev-server --watch --inline",
"postinstall": "typings install"
},
// ...
}