Created
September 21, 2018 07:58
-
-
Save danman113/33c508375d37bc4319cf63b9c5318dbf 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
let path = require('path') | |
let HtmlWebpackPlugin = require('html-webpack-plugin') | |
module.exports = { | |
entry: './src/index.ts', | |
output: { | |
filename: 'out.js', | |
path: __dirname + '/dist' | |
}, | |
mode: 'development', | |
// Enable sourcemaps for debugging webpack's output. | |
devtool: 'source-map', | |
resolve: { | |
// Add '.ts' as a resolvable extensions. | |
extensions: ['.ts', '.js', '.json'] | |
}, | |
module: { | |
rules: [ | |
{ test: /\.ts$/, loader: 'awesome-typescript-loader' }, | |
{ test: /\.txt$/, loader: 'raw-loader' } | |
] | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
title: 'Demo', | |
template: 'src/index.html', | |
inject: 'head' | |
}) | |
], | |
devServer: { | |
contentBase: path.join(__dirname, 'dist'), | |
compress: true, | |
hot: true, | |
port: 9001 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment