Skip to content

Commit

Permalink
#35; add webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Apr 6, 2017
1 parent 69d5932 commit 709ca27
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var bannerjs = require('bannerjs'),
webpack = require('webpack');

module.exports = function(env) {

var config = {
context: __dirname,
entry: './src/search.js',
output: {
filename: 'gensearch.js',
path: __dirname + '/dist',
library: 'gensearch',
libraryTarget: 'umd'
},
plugins: [
new webpack.BannerPlugin({
banner: bannerjs.onebanner(),
raw: true
})
]
};

// Minify for production build
if(env && env.production){
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
config.output.filename = 'gensearch.min.js';
}

return config;
};

0 comments on commit 709ca27

Please sign in to comment.