Migrates banner from Browserify to Webpack #372

This commit is contained in:
Zeno Rocha 2018-02-28 20:32:12 -08:00
parent f7e2f58c96
commit d25dcac817
2 changed files with 15 additions and 12 deletions

View File

@ -1,6 +0,0 @@
/*!
* clipboard.js v<%= pkg.version %>
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/

View File

@ -1,7 +1,13 @@
var path = require('path');
var webpack = require('webpack');
const pkg = require('./package.json');
const path = require('path');
const webpack = require('webpack');
var production = process.env.NODE_ENV === 'production' || false;
const production = process.env.NODE_ENV === 'production' || false;
const banner = `clipboard.js v${pkg.version}
https://zenorocha.github.io/clipboard.js
Licensed MIT © Zeno Rocha`;
module.exports = {
entry: './src/clipboard.js',
@ -13,7 +19,7 @@ module.exports = {
},
module: {
rules: [
{test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"}
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}
]
},
plugins: production ? [
@ -27,6 +33,9 @@ module.exports = {
screw_ie8: true
},
comments: false
})
] : []
}),
new webpack.BannerPlugin({banner})
] : [
new webpack.BannerPlugin({banner})
]
};