-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.config.js
49 lines (47 loc) · 1.02 KB
/
webpack.test.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
var path = require('path');
var webpack = require('webpack');
var HtmlwebpackPlugin = require('html-webpack-plugin');
var ROOT_PATH = path.resolve(__dirname);
var APP_PATH = path.resolve(ROOT_PATH, 'app');
var TEST_PATH = path.resolve(ROOT_PATH, 'tests');
var TEM_PATH = path.resolve(ROOT_PATH, 'templates');
module.exports = {
entry: 'mocha!./tests/test.js',
output: {
filename: 'test.build.js',
path: TEST_PATH
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
include: APP_PATH,
query: {
presets: ['es2015']
}
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
include: APP_PATH
},
{
test: /\.(png|jpg)$/,
loader: 'url?limit=40000'
}
]
},
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
progress: true,
},
plugins: [
new HtmlwebpackPlugin({
title: 'Test case',
template: path.resolve(TEM_PATH, 'test.html')
}),
]
}