Created
September 26, 2016 12:57
-
-
Save devopsmariocom/08ef73eb2286963a5674f66a4095ab53 to your computer and use it in GitHub Desktop.
Minimal Webpack 2 config
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 { resolve } = require('path'); | |
const webpack = require('webpack'); | |
// plugins | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = (env) => { | |
return { | |
context: resolve('src'), | |
entry: { | |
app: './main.ts' | |
}, | |
output: { | |
filename: '[name].[hash].js', | |
path: resolve('dist'), | |
// Include comments with information about the modules. | |
pathinfo: true, | |
}, | |
resolve: { | |
extensions: [ | |
'', | |
'.js', | |
'.ts', | |
'.tsx' | |
] | |
}, | |
devtool: 'cheap-module-source-map', | |
module: { | |
loaders: [ | |
{ test: /\.tsx?$/, loaders: [ 'awesome-typescript-loader' ], exclude: /node_modules/ } | |
], | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: resolve('src','index.html') | |
}) | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment