forked from clappr/clappr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
59 lines (57 loc) · 1.42 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
var path = require('path');
var webpack = require('webpack');
var Clean = require('clean-webpack-plugin');
var plugins = [
new webpack.DefinePlugin({
VERSION: JSON.stringify(require('./package.json').version)
})
];
if (process.env.npm_lifecycle_event === 'release') {
plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {warnings: false},
output: {comments: false}
}));
} else {
plugins.push(new Clean(['dist']));
}
module.exports = {
entry: path.resolve(__dirname, 'src/main.js'),
plugins: plugins,
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
},
{
test: /\.scss$/,
loaders: ['css', 'sass?includePaths[]='
+ path.resolve(__dirname, './node_modules/compass-mixins/lib')
+ '&includePaths[]='
+ path.resolve(__dirname, './src/base/scss')
],
include: path.resolve(__dirname, 'src'),
},
{
test: /\.(png|woff|eot|ttf|swf)/, loader: 'url-loader?limit=1'
},
{
test: /\.svg/, loader: 'file-loader'
},
{
test: /\.html/, loader: 'html?minimize=false'
}
],
},
resolve: {
root: path.resolve(__dirname, 'src'),
extensions: ['', '.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '<%=baseUrl%>/',
filename: 'clappr.js',
library: 'Clappr',
libraryTarget: 'umd',
},
};