-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathwebpack.config.js
59 lines (47 loc) · 1.4 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
52
53
54
55
56
57
58
59
var path = require('path');
var webpack = require('webpack');
var outputFileName = 'bundle';
var config = {
//context: path.resolve(__dirname, './'),
entry: path.resolve(__dirname, './client/index.ts'),
output: {
// output to './dist' folder
path: path.resolve(__dirname, './dist'),
// with filename
filename: outputFileName + '.js',
// mark /dist/ folder as a public path so index.html can reach it
publicPath: '/dist/'
},
// webpack-dev-server config, see: https://webpack.github.io/docs/webpack-dev-server.html
devServer: {
contentBase: './',
hot: true,
inline: true,
port: 8080
},
// http://webpack.github.io/docs/configuration.html#devtool
devtool: '#eval-source-map',
resolve: {
extensions: ['.ts', '.js', '.jade'],
alias: {
'vue$': 'vue/dist/vue.js'
}
},
module: {
loaders: [
{ test: /\.html$/, loader: 'html' },
{ test: /\.jade$/, loader: 'jade-loader' },
{
test: /\.ts?$/,
include: /client/,
exclude: /node_modules/,
loader: "ts-loader"
}
]
},
plugins: [
// HMR issue, see: https://github.com/webpack/webpack/issues/1151
new webpack.HotModuleReplacementPlugin()
]
};
module.exports = config;