forked from infernojs/inferno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.conf.js
60 lines (58 loc) · 1.29 KB
/
webpack.dev.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
const webpack = require('webpack');
const glob = require('glob');
const path = require('path');
const testFiles = glob.sync('./src/**/*__tests__*/**/*.ts')
.concat(glob.sync('./src/**/*__tests__*/**/*.tsx'))
.concat(glob.sync('./src/**/*__tests__*/**/*.js'))
.concat(glob.sync('./src/**/*__tests__*/**/*.jsx'));
module.exports = {
watch: true,
entry: testFiles,
output: {
filename: '__spec-build.js'
},
// devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.tsx?$/,
loaders: ['babel-loader', 'ts-loader'],
exclude: /node_modules/
}, {
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
compact: false,
presets: ['es2015'],
plugins: [
'transform-object-rest-spread',
'babel-plugin-syntax-jsx',
'babel-plugin-inferno'
]
}
}
]
},
devServer: {
contentBase: './',
port: 8080,
noInfo: false,
hot: true,
inline: true,
historyApiFallback: {
index: '/config/index.html'
}
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
plugins: [
// By default, webpack does `n=>n` compilation with entry files. This concatenates
// them into a single chunk.
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
}),
new webpack.HotModuleReplacementPlugin()
]
};