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'); const pkg = require('./package.json');
var webpack = require('webpack'); 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 = { module.exports = {
entry: './src/clipboard.js', entry: './src/clipboard.js',
@ -13,7 +19,7 @@ module.exports = {
}, },
module: { module: {
rules: [ rules: [
{test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"} {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}
] ]
}, },
plugins: production ? [ plugins: production ? [
@ -27,6 +33,9 @@ module.exports = {
screw_ie8: true screw_ie8: true
}, },
comments: false comments: false
}) }),
] : [] new webpack.BannerPlugin({banner})
] : [
new webpack.BannerPlugin({banner})
]
}; };