configs
Our js dependencies are just going to be
webpack
and typescript
package.json
{
"name": "ToDo List",
"version": "0.1.0",
"description": "A webapp for managing things you need todo",
"main": "ts/app.ts",
"author": "you",
"license": "MIT",
"dependencies": {
},
"devDependencies": {
"awesome-typescript-loader": "^5.0.0",
"typescript": "^2.8.3",
"webpack": "^4.6.0",
"webpack-cli": "^2.0.15"
}
}
Just about the most simple typescript configuration.
noImplicitAny
is turned off because the WebAssembly
object isn't defined in my current version of typescript.
tsconfig.json
{
"compilerOptions": {
"noImplicitAny": false,
"lib": [
"dom",
"es2015"
]
}
}
Almost a bare bones
webpack.config.js
though we need to include the resolve.extensions
and the module.rules
items to compile typescript
.
webpack.config.js
const path = require('path');
module.exports = {
entry: {
'app': './ts/app.ts'
},
output: {
path: path.resolve(__dirname, 'dist', 'js'),
filename: '[name].js'
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
use: 'awesome-typescript-loader'
}
]
},
mode: 'development'
}