forked from webpack/webpack-with-common-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
54 lines (50 loc) · 1.5 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
var path = require("path");
var webpack = require("webpack");
module.exports = {
cache: true,
entry: {
jquery: "./app/jquery",
bootstrap: ["!bootstrap-webpack!./app/bootstrap/bootstrap.config.js", "./app/bootstrap"],
react: "./app/react"
},
output: {
path: path.join(__dirname, "dist"),
publicPath: "dist/",
filename: "[name].js",
chunkFilename: "[chunkhash].js"
},
module: {
loaders: [
// required to write "require('./style.css')"
{ test: /\.css$/, loader: "style-loader!css-loader" },
// required for bootstrap icons
{ test: /\.woff$/, loader: "url-loader?prefix=font/&limit=5000&mimetype=application/font-woff" },
{ test: /\.ttf$/, loader: "file-loader?prefix=font/" },
{ test: /\.eot$/, loader: "file-loader?prefix=font/" },
{ test: /\.svg$/, loader: "file-loader?prefix=font/" },
// required for react jsx
{ test: /\.js$/, loader: "jsx-loader" },
{ test: /\.jsx$/, loader: "jsx-loader?insertPragma=React.DOM" },
]
},
resolve: {
alias: {
// Bind version of jquery
jquery: "jquery-2.0.3",
// Bind version of jquery-ui
"jquery-ui": "jquery-ui-1.10.3",
// jquery-ui doesn't contain a index file
// bind module to the complete module
"jquery-ui-1.10.3$": "jquery-ui-1.10.3/ui/jquery-ui.js",
}
},
plugins: [
new webpack.ProvidePlugin({
// Automtically detect jQuery and $ as free var in modules
// and inject the jquery library
// This is required by many jquery plugins
jQuery: "jquery",
$: "jquery"
})
]
};