-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (37 loc) · 1.1 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
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var path = require('path');
var del = require('del');
var DIST = path.join(__dirname, 'dist');
del(DIST);//delete the dist folder
module.exports = {
context: path.join(__dirname, 'app'),
entry: {
index: './index.js',
profile: './profile.js',
dashboard: './dashboard.js',
vendor: ['jquery', 'underscore', 'a']
},
output: {
filename: '[name].bundle.js',
path: DIST,
publicPath: 'dist/',
jsonpFunction: 'seajs',
chunkFilename: '[name].[hash].js'
},
resolve: {
// root: path.join(__dirname, 'app'),
modulesDirectories: ['node_modules', 'bower_components']
},
module: {
loaders: [
{test: '/\.js$/', loader: 'uglify'}
]
},
plugins: [
new webpack.ResolverPlugin(new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])),
new CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
new webpack.ProvidePlugin({'$': 'jquery', 'jQuery': 'jquery', 'window.jQuery': 'jquery'}),
new webpack.optimize.UglifyJsPlugin()
]
};