-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.test.serve.js
74 lines (72 loc) · 1.89 KB
/
webpack.test.serve.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
69
70
71
72
73
74
/* global module, __dirname, process */
var path = require("path");
var webpack = require("webpack");
// plugin
var HtmlWebpackPlugin = require("html-webpack-plugin");
var DefineWebpackPlugin = webpack.DefinePlugin;
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry : {
tests : path.join(__dirname, "test")
},
output : {
path : path.join(__dirname),
filename : "[name].js",
libraryTarget : "umd"
},
resolve : {
alias : {
"itowns" : path.join(__dirname, "node_modules", "itowns", "lib", "MainBundle.js")
}
},
externals : ["request", "xmldom"],
devtool : "eval-source-map",
devServer : {
stats : "errors-only",
host : "localhost",
port : 9001,
hot : true,
open : "google-chrome",
watchOptions : {
watch : true,
poll : true
},
overlay : {
errors : true,
warnings : false
}
},
module: {
rules : [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test : /\.(png|jpg|gif|svg)$/,
loader : "url-loader",
options: {
fallback : "responsive-loader",
quality : 100
}
}
]
},
plugins : [
// on veut les logs !
new DefineWebpackPlugin({
__PRODUCTION__ : JSON.stringify(false),
__SWITCH2D3D_ALLOWED__ : JSON.stringify(true)
}),
new HtmlWebpackPlugin({
title : "Mocha Tests Units",
filename : "index.html",
template : require.resolve(
"html-webpack-plugin/default_index.ejs"
)
})
]
};