This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
51 lines (46 loc) · 1.51 KB
/
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
42
43
44
45
46
47
48
49
50
51
var path = require('path'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
jade = require('jade');
module.exports = {
entry: './src/client/bootstrap.ts',
devtool: "source-map",
output: {
path: path.join(__dirname, "dist/client"),
filename: 'assets/bundle-[hash].js',
sourceMapFilename: 'assets/[name].map',
chunkFilename: 'assets/[id].chunk.js'
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js']
},
module: {
loaders: [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.jade$/, loader: 'jade' },
{ test: /\.json$/, loader: 'json' },
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css')
},
{
test: /\.(woff2?|svg|png)$/,
loader: 'url?limit=10000&name=assets/[hash].font.[ext]'
},
{
test: /\.(ttf|eot|woff)$/,
loader: 'file?name=assets/[hash].font.[ext]'
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'Developer Conference Video Player',
filename: 'index.html',
templateContent: function(templateParams, compilation) {
return jade.compileFile('src/client/index.jade')(templateParams);
}
}),
new ExtractTextPlugin('assets/[name]-[hash].css')
]
}