forked from trevorhanus/reactx-todo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (58 loc) · 1.5 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
60
61
const path = require('path');
const webpack = require('webpack');
const TSLintPlugin = require('tslint-webpack-plugin');
const commonConfig = {
devtool: 'eval',
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new TSLintPlugin({
files: ['./src/**/*.ts', './src/**/*.tsx', './src/**/*.d.ts'],
project: './tsconfig.json'
}),
],
module: {
loaders: [
{
test: /\.tsx?$/,
loaders: ['awesome-typescript-loader']
},
{
test: /\.json?$/,
loaders: ['json-loader']
},
{
test: /\.less?$/,
loaders: [
'style-loader',
'css-loader',
'less-loader'
]
},
{
test: /\.((woff2?|svg)(\?v=[0-9]\.[0-9]\.[0-9]))|(woff2?|svg|jpe?g|png|gif|ico)$/,
loader: 'url-loader?limit=10000'
},
{
test: /\.((ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9]))|(ttf|eot)$/,
loader: 'file-loader'
}
]
}
};
const index = Object.assign({}, commonConfig, {
name: 'index',
entry: [
'./src/index.tsx'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
}
});
module.exports = [
index
];