Created
September 7, 2018 08:40
-
-
Save namtx/d96ded8dd20e12eef0f252758194d7e2 to your computer and use it in GitHub Desktop.
Typescript with Webpack
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": "ts-playground", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"scripts": { | |
"run": "webpack --mode development --display none && node dist/bundle.js", | |
"start": "webpack --mode development", | |
"build": "webpack --mode production" | |
}, | |
"devDependencies": { | |
"eslint": "^5.5.0", | |
"eslint-config-airbnb-base": "^13.1.0", | |
"eslint-plugin-import": "^2.14.0", | |
"ts-loader": "^5.0.0", | |
"typescript": "^3.0.3", | |
"webpack": "^4.17.2", | |
"webpack-cli": "^3.1.0", | |
"webpack-dev-server": "^3.1.8" | |
} | |
} |
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'); | |
module.exports = { | |
entry: './src/index.ts', | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
exclude: /node_modules/, | |
use: { | |
loader: 'ts-loader', | |
}, | |
}, | |
], | |
}, | |
resolve: { | |
extensions: ['.ts', '.js'], | |
}, | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist'), | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment