forked from videokitio/clappr-youtube-playback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
63 lines (61 loc) · 1.51 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
60
61
62
63
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/index.js'),
plugins: plugins,
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.s?css$/,
loaders: ['css', 'sass?includePaths[]='
+ path.resolve(__dirname, './node_modules/compass-mixins/lib')
+ '&includePaths[]='
+ path.resolve(__dirname, './node_modules/clappr/src/base/scss')
],
include: path.resolve(__dirname, 'src')
},
{
test: /\.(png|woff|eot|ttf|swf)/, loader: 'url-loader?limit=1'
},
{
test: /\.svg/, loader: 'svg-inline'
},
{
test: /\.html/, loader: 'html?minimize=true'
}
]
},
resolve: {
root: path.resolve(__dirname, 'src'),
extensions: ['', '.js']
},
externals: {
'Clappr': 'Clappr'
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '<%=baseUrl%>/',
filename: 'clappr-youtube-playback.js',
library: 'YoutubePlayback',
libraryTarget: 'umd'
}
}