-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (47 loc) · 1.73 KB
/
webpack.config.js
File metadata and controls
50 lines (47 loc) · 1.73 KB
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
/*
* @Author: Pedro Mello (MushDigital)
* @email: [email protected]
* @Date: 2015-08-14
*/
var webpack = require('webpack');
var path = require('path');
var root_path = path.resolve(__dirname,'..');
var node_modules_path = path.resolve(root_path,'node_modules');
var node_config_path = path.resolve(root_path,'config');
var build_path = path.resolve(root_path, 'src');
var main_path = path.resolve(build_path, 'src', 'main.coffee');
var assets_path = path.join(build_path,'assets');
var scripts_path = path.join(assets_path,'scripts');
var controllers_path = path.join(scripts_path,'controllers');
console.log(root_path);
var config = {
devtool: 'source-map',
entry:'./src/app.coffee',
output:{
path:build_path,
filename:'bundle.js',
},
module: {
loaders: [
{test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery'},
// loads bootstrap's css.
{test: /\.(png)$/, loader: 'url-loader?limit=100000'},
{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: /\.css$/,loader: 'style!css'},
{test: /\.coffee$/, loader: "coffee-loader"},
{test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate"},
{test: /\.ejs$/, loader: "ejs-loader?variable=data"},
{test: /\.less$/,loader: "style!css!less?strictMath&noIeCompat"}
]
},
plugins:[
new webpack.HotModuleReplacementPlugin(),
//new webpack.ProvidePlugin({_: "underscore"}),
new webpack.ProvidePlugin({$: "jquery",jQuery: "jquery","window.jQuery": "jquery"}),
],
resolve: {
extensions: ['', '.js', '.json', '.coffee']
}
};
module.exports = config;