-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
45 lines (44 loc) · 1.18 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
var path = require('path');
var webpack = require('webpack');
var nodeModulesPath = path.join(__dirname, 'node_modules');
var bowerComponentsPath = path.join(__dirname, 'bower_components');
module.exports = {
entry: './src/main.js',
output: {
path: __dirname + "/dist",
filename: 'main.js',
library: 'MyLibrary',
libraryTarget: 'umd'
},
module: {
loaders: [
{test: /jquery\.js$/, loader: "exports?jQuery!script"},
{test: /\.js$/, exclude: /node_modules|bower_components/, loader: 'babel-loader'},
{test: /\.handlebars$/, loader: 'handlebars-loader'},
{test: /\.less$/, loader: "style!css!less"},
{test: /\.css$/, loader: "style!css"},
{test: /\.(otf|eot|png|gif|svg|ttf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader"}
],
noParse: []
},
resolve: {
root: [
nodeModulesPath,
bowerComponentsPath],
alias: {
"jquery$": "jquery/dist/jquery.js",
"lodash$": "lodash/lodash.js"
},
extensions: ['',
'.js',
'.css']
},
bail:true,
plugins: [
//new webpack.optimize.DedupePlugin(),
new webpack.ProvidePlugin({
$: "jquery",
_: "lodash"
})
]
};