-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.conf.js
68 lines (66 loc) · 1.49 KB
/
webpack.conf.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
60
61
62
63
64
65
66
67
68
var webpack = require('webpack');
var path = require('path');
const webpackConfig = {
entry: {
tsx: './src/main.tsx',
html: './src/index.html'
},
output: {
path: path.join(__dirname, './dist'),
filename: 'bundle.js'
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
preLoaders: [
{
test: /\.ts(x?)$/,
loader: 'tslint',
include: path.resolve(__dirname, './src')
}
],
loaders: [{
test: /\.html$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.css$/,
exclude: /styles/,
loaders: [
'style-loader',
'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
'postcss-loader'
]
}, {
test: /\.css$/,
include: /styles/,
loaders: [
'style-loader',
'css-loader?sourceMap',
'postcss-loader'
]
}, {
test: /\.ts(x?)$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react!ts-loader'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}]
},
tslint: {
emitErrors: false,
formattersDirectory: path.resolve(__dirname, './node_modules/tslint-loader/formatters/')
},
plugins: [
new webpack.NoErrorsPlugin()
],
devServer: {
stats: { colors: true },
}
};
module.exports = webpackConfig;