-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (39 loc) · 972 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const path = require('path')
const webpack = require('webpack')
const WebpackMd5Hash = require('webpack-md5-hash')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
const config = {
entry: {
vendor: './src/vendor.tsx',
main: './src/app.tsx'
},
output: {
path: path.join(__dirname, '/public'),
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
new WebpackMd5Hash(),
new InlineManifestWebpackPlugin({
name: 'webpackManifest'
}),
new HtmlWebpackPlugin({
template: './src/index.ejs'
})
],
module: {
rules: [{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader'
}]
}
}
module.exports = [config]