forked from Dmytro-Medzatiy/react-ui-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-dev.config.js
47 lines (45 loc) · 1.65 KB
/
webpack-dev.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
var webpack = require("webpack");
module.exports = [
{
name: "browser",
entry: {
main: './client/src/main.js'
},
output: {
path: './build/html',
filename: 'builder-bundle.js'
},
//devtool: "eval",
debug: true,
module: {
loaders: [
//{ test: /\.js$/, exclude: /node_modules/, loader: 'jsx-loader?harmony' },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.css$/, exclude: /node_modules/, loader: "style-loader!css-loader" },
{ test: /\.less$/, exclude: /node_modules/, loader: "style-loader!css-loader!less-loader"},
//{ test: /\.(eot|woff|ttf|svg|png|jpg)([\?]?.*)$/, loader: 'url-loader?limit=8000&name=[name]-[hash].[ext]' }
{ test: /\.(eot|woff|ttf|svg|png|jpg)([\?]?.*)$/, exclude: /node_modules/, loader: 'url-loader' }
//{ test: /\.(eot|woff|ttf)([\?]?.*)$/, loader: "file-loader" }
//{ test: /[\\\/]node_modules[\\\/]modernizr[\\\/]modernizr-build\.js$/,
// loader: "imports?this=>window!exports?window.Modernizr" }
]
},
externals: {
// require("jquery") is external and available
// on the global var jQuery
"jquery": "jQuery"
}
},
{
name: "server",
entry: {
api: './server/src/api.js'
},
output: {
path: './build/lib',
filename: '[name].js',
libraryTarget: 'commonjs2'
},
externals: /^[a-z\-0-9_]+$/
}
];