rollup-plugin-uglify
Advanced tools
Comparing version 3.0.0 to 4.0.0
14
index.js
@@ -1,7 +0,5 @@ | ||
const minify = require("uglify-es").minify; | ||
const { codeFrameColumns } = require("@babel/code-frame"); | ||
const { minify } = require("uglify-js"); | ||
function uglify(userOptions, minifier) { | ||
if (minifier === undefined) { | ||
minifier = minify; | ||
} | ||
function uglify(userOptions, minifier = minify) { | ||
const options = Object.assign({ sourceMap: true }, userOptions); | ||
@@ -15,2 +13,6 @@ | ||
if (result.error) { | ||
const { message, line, col: column } = result.error; | ||
console.error( | ||
codeFrameColumns(code, { start: { line, column } }, { message }) | ||
); | ||
throw result.error; | ||
@@ -23,2 +25,2 @@ } | ||
module.exports = uglify; | ||
exports.uglify = uglify; |
{ | ||
"name": "rollup-plugin-uglify", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Rollup plugin to minify generated bundle", | ||
@@ -26,9 +26,14 @@ "main": "index.js", | ||
"dependencies": { | ||
"uglify-es": "^3.3.7" | ||
"@babel/code-frame": "^7.0.0-beta.47", | ||
"uglify-js": "^3.3.25" | ||
}, | ||
"devDependencies": { | ||
"jest": "^22.1.4", | ||
"prettier": "^1.10.2", | ||
"rollup": "^0.54.1" | ||
"@babel/core": "^7.0.0-beta.47", | ||
"@babel/preset-env": "^7.0.0-beta.47", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-jest": "^22.4.4", | ||
"jest": "^22.4.4", | ||
"prettier": "^1.12.1", | ||
"rollup": "^0.59.1" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # rollup-plugin-uglify [![Travis Build Status][travis-img]][travis] | ||
import { rollup } from 'rollup'; | ||
import uglify from 'rollup-plugin-uglify'; | ||
import { uglify } from 'rollup-plugin-uglify'; | ||
@@ -35,5 +35,5 @@ rollup({ | ||
`options` – default: `{}`, type: `object`. [UglifyJS API options](https://github.com/mishoo/UglifyJS2#api-reference) | ||
`options` – default: `{}`, type: `object`. [UglifyJS API options](https://github.com/mishoo/UglifyJS2/blob/master/README.md#minify-options) | ||
`minifier` – default: `require('uglify-es').minify`, type: `function`. Module to use as a minifier. You can use other versions (or forks) of UglifyJS instead default one. | ||
`minifier` – default: `require('uglify-js').minify`, type: `function`. Module to use as a minifier. You can use other versions (or forks) of UglifyJS instead default one. | ||
@@ -71,3 +71,3 @@ ## Examples | ||
See [UglifyJS documentation](https://github.com/mishoo/UglifyJS2#keeping-comments-in-the-output) for further reference. | ||
See [UglifyJS documentation](https://github.com/mishoo/UglifyJS2/blob/master/README.md) for further reference. | ||
@@ -74,0 +74,0 @@ # License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4254
20
2
7
+ Addeduglify-js@^3.3.25
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addeduglify-js@3.19.3(transitive)
- Removeduglify-es@^3.3.7
- Removedcommander@2.14.1(transitive)
- Removedsource-map@0.6.1(transitive)
- Removeduglify-es@3.3.10(transitive)