forked from mxcube/mxcubeweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
94 lines (90 loc) · 2.25 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
var webpack = require("webpack");
var path = require('path');
var backend_server = require('./backend_server.js');
var config = {
entry: {
main: ['main.jsx'],
},
output: {
path: path.resolve(__dirname, 'mxcube3','static'),
filename: '[name].js',
publicPath: ''
},
devServer: {
proxy: {
'/mxcube/api/*': {
target: backend_server
},
'/socket.io/*': {
target: backend_server,
ws: true
},
},
},
module: {
preLoaders: [
{
test: /\.jsx?$/,
loaders: ['eslint'],
exclude: /node_modules/
}
],
loaders: [
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /isotope-layout/,
loader: 'imports?define=>false&this=>window'
},
{
test: /\.less$/,
loader: "style!css!less"
},
{
test: /\.jsx?$/,
loaders: ['react-hot', 'babel-loader?presets[]=react,presets[]=es2015,presets[]=stage-0,plugins[]=transform-decorators-legacy'],
exclude: /node_modules/
},
{
test: /isotope\-|fizzy\-ui\-utils|desandro\-|masonry|outlayer|get\-size|doc\-ready|eventie|eventemitter|classie|get\-style\-property|packery/,
loader: 'imports?define=>false&this=>window'
},
{test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' },
{test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" },
{
test: /\.(jpe?g|png|gif)$/i,
loaders: [
'url?limit=8192',
'img'
]
},
]
},
eslint: {
configFile: '.eslintrc'
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
],
externals: {
'guiConfig': JSON.stringify(require('./config.gui.prod.js'))
},
resolve: {
root: path.resolve(__dirname, 'mxcube3/ui'),
alias: {
'masonry': 'masonry-layout',
'isotope': 'isotope-layout'
},
extensions: ['', '.js', '.jsx']
},
}
module.exports = config;