Compare commits

...

10 Commits

Author SHA1 Message Date
Zeno Rocha
5be63e28dd 2.0.3 2018-11-11 18:56:51 -08:00
Rouven Weßling
adc669df06 Always run webpack in production mode. (#595)
Otherwise horribly inefficent code that evals(!) strings of code is generated.
2018-11-11 18:53:43 -08:00
Rouven Weßling
b57e6d019f Don't claim to support ESM 2018-11-11 18:51:00 -08:00
Rouven Weßling
3d005b547e Maintain banner in minified file 2018-11-11 18:49:23 -08:00
Zeno Rocha
cf9e8fd7ce Updates devDependencies 2018-11-11 09:58:44 -08:00
Zeno Rocha
f1d99de5d3 Removes .npmignore file 2018-11-11 09:48:15 -08:00
Zeno Rocha
fdb66d3f16 2.0.2 2018-11-11 09:14:19 -08:00
Zeno Rocha
e0f82241d0 Removes bundle analyzer 2018-11-11 09:10:37 -08:00
Zeno Rocha
4d4c25c505 Updates Webpack CLI 2018-11-11 08:20:47 -08:00
Samuel Oloruntoba
5ef3f1a817 Migrates to Webpack 4 2018-11-11 08:17:25 -08:00
10 changed files with 9350 additions and 665 deletions

View File

@@ -1,4 +1,3 @@
{
"presets": ["es2015"],
"plugins": ["transform-es2015-modules-umd"]
"presets": ["env"]
}

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@ lib
npm-debug.log
bower_components
node_modules
yarn-error.log
yarn.lock

View File

@@ -1,7 +0,0 @@
/.*/
/demo/
/test/
/.*
/bower.json
/karma.conf.js
/src

View File

@@ -1,6 +1,6 @@
{
"name": "clipboard",
"version": "2.0.0",
"version": "2.0.3",
"description": "Modern copy to clipboard. No Flash. Just 3kb",
"license": "MIT",
"main": "dist/clipboard.js",

1281
dist/clipboard.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

8645
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
Package.describe({
name: "zenorocha:clipboard",
summary: "Modern copy to clipboard. No Flash. Just 3kb.",
version: "2.0.0",
version: "2.0.3",
git: "https://github.com/zenorocha/clipboard.js"
});

View File

@@ -1,11 +1,10 @@
{
"name": "clipboard",
"version": "2.0.1",
"version": "2.0.3",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"repository": "zenorocha/clipboard.js",
"license": "MIT",
"main": "dist/clipboard.js",
"module": "dist/clipboard.js",
"keywords": [
"clipboard",
"copy",
@@ -17,30 +16,35 @@
"tiny-emitter": "^2.0.0"
},
"devDependencies": {
"babel-cli": "^6.5.1",
"babel-core": "^6.5.2",
"babel-loader": "^6.2.10",
"babel-plugin-transform-es2015-modules-umd": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"chai": "^3.4.1",
"cross-env": "^3.1.4",
"karma": "^1.3.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"chai": "^4.2.0",
"cross-env": "^5.2.0",
"karma": "^3.1.1",
"karma-chai": "^0.1.0",
"karma-mocha": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sinon": "^1.0.4",
"karma-webpack": "^2.0.2",
"mocha": "^3.1.2",
"karma-webpack": "^3.0.5",
"mocha": "^5.2.0",
"phantomjs-prebuilt": "^2.1.4",
"sinon": "^1.17.2",
"webpack": "^2.2.1"
"sinon": "^7.1.1",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^3.1.2"
},
"scripts": {
"build": "npm run build-debug && npm run build-min",
"build-debug": "webpack",
"build-min": "cross-env NODE_ENV=production webpack --optimize-minimize",
"build-min": "cross-env NODE_ENV=production webpack",
"build-watch": "webpack --watch",
"test": "karma start --single-run",
"prepublish": "npm run build"
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

View File

@@ -1,6 +1,7 @@
const pkg = require('./package.json');
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const production = process.env.NODE_ENV === 'production' || false;
@@ -11,6 +12,7 @@ Licensed MIT © Zeno Rocha`;
module.exports = {
entry: './src/clipboard.js',
mode: 'production',
output: {
filename: production ? 'clipboard.min.js' : 'clipboard.js',
path: path.resolve(__dirname, 'dist'),
@@ -22,20 +24,21 @@ module.exports = {
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}
]
},
plugins: production ? [
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true
},
compress: {
screw_ie8: true
},
comments: false
}),
new webpack.BannerPlugin({banner})
] : [
new webpack.BannerPlugin({banner})
optimization: {
minimize: production,
minimizer: [
new UglifyJSPlugin({
parallel: require('os').cpus().length,
uglifyOptions: {
ie8: false,
keep_fnames: false,
output: {
beautify: false,
comments: (node, {value, type}) => type == 'comment2' && value.startsWith('!')
}
}
})
]
},
plugins: [new webpack.BannerPlugin({ banner })]
};