-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (54 loc) · 1.63 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
var webpack = require("webpack");
module.exports = {
//cache generated modules when watching (improves refresh performance)
cache: true,
//the source path for the entry points
context: __dirname + "/app",
//"entry" point, IE the seed file for this application
entry: { index: ["index.js"] },
resolve: {
//setup aliases for bower modules
//NOTE: Bower modules do not need aliases if you require the full path past bower_components ie
// if i added module "foo" via bower, it would auto resolve foo/index.js if you require "foo", or you could
// require('foo/foo.js').
alias: {
"lodash": "lodash/dist/lodash.js",
"jquery": "jquery/dist/jquery.js",
"can": "canjs/amd/can",
"moment": "moment/moment.js"
},
//lookup modules in the following directories
modulesDirectories: ["bower_components", "node_modules", "app"]
},
plugins: [
//rewrite module internal references looking for the source regex to the replace target
new webpack.ContextReplacementPlugin(/canjs[\/\\]amd/, /^$/),
//these items will be available in all modules that use them internally w/o having to require them explicitly
new webpack.ProvidePlugin({
"_": "lodash",
$: "jquery",
jQuery: "jquery",
can: "can"
})
],
stats: {
// Configure console output
colors: true,
modules: true,
reasons: true
},
failOnError: false, // don't report error to grunt if webpack find errors,
module: {
//some custom CanJS loaders, courtesy of https://github.com/sykopomp
loaders: [
{
test: /\.ejs/,
loader: "transform/cacheable?can.viewify"
},
{
test: /\.mustache/,
loader: "transform/cacheable?can.viewify"
}
]
}
};