-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
67 lines (65 loc) · 2.22 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
var path = require("path");
var webpack = require("webpack");
var ENV = process.env.NODE_ENV || "development";
module.exports = {
// This is the main file that should include all other JS files
entry: "./app/js/main.js",
target: "web",
debug: true,
cache: true,
output: {
path: path.join(__dirname, "dist/assets"),
publicPath: "dist/assets",
// If you want to generate a filename with a hash of the content (for cache-busting)
// filename: "main-[hash].js",
filename: "main.js",
chunkFilename: "[chunkhash].js"
},
resolve: {
alias: {
react$: "react/addons",
jquery$: "jquery/dist/jquery",
bootstrap$: "bootstrap-sass/assets/javascripts/bootstrap",
'ozp-react-commons': 'ozp-react-commons/app/js'
},
// Tell webpack to look for required files in bower and node
modulesDirectories: ['bower_components', 'node_modules'],
},
module: {
preLoaders: [{
test: /\.jsx?$/,
loader: "jsxhint-loader",
exclude: /node_modules|bower_components|gulp|dist/
}],
loaders: [
{ test: /\.css/, loader: "style-loader!css-loader" },
{ test: /\.gif/, loader: "url-loader?limit=10000&mimetype=image/gif" },
{ test: /\.jpg/, loader: "url-loader?limit=10000&mimetype=image/jpg" },
{ test: /\.png/, loader: "url-loader?limit=10000&mimetype=image/png" },
{
test: /\.jsx?$/,
loader: "jsx-loader?insertPragma=React.DOM!babel-loader?experimental&optional=runtime",
include: [
path.join(__dirname, 'app/js'),
path.join(__dirname, 'node_modules/ozp-react-commons/app/js')
]
}
],
noParse: /\.min\.js/
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
// This has effect on the react lib size
"NODE_ENV": JSON.stringify(ENV),
}
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
externals: {
OzoneConfig: 'OzoneConfig'
}
};