diff --git a/CHANGELOG.md b/CHANGELOG.md index a067a9e..4a658ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/). --- +## [7.0.0] +### Added +* [#143] **BREAKING CHANGE**: add support for Rollup `^1.0.0`. + +### Removed +* [#143] **BREAKING CHANGE**: remove support for Rollup < 1: +* [#143] **BREAKING CHANGE**: remove support for legacy syntax of banner. + ## [6.2.0] – 2018-11-22 ### Added * [#138] Ability to add plugins to Babel. @@ -152,7 +160,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). [#133]: https://github.com/Comandeer/rollup-plugin-babel-minify/issues/133 [#137]: https://github.com/Comandeer/rollup-plugin-babel-minify/issues/137 [#138]: https://github.com/Comandeer/rollup-plugin-babel-minify/issues/138 +[#143]: https://github.com/Comandeer/rollup-plugin-babel-minify/pull/143 +[7.0.0]: https://github.com/Comandeer/rollup-plugin-babel-minify/compare/v6.2.0...v7.0.0 [6.2.0]: https://github.com/Comandeer/rollup-plugin-babel-minify/compare/v6.1.1...v6.2.0 [6.1.1]: https://github.com/Comandeer/rollup-plugin-babel-minify/compare/v6.1.0...v6.1.1 [6.1.0]: https://github.com/Comandeer/rollup-plugin-babel-minify/compare/v6.0.0...v6.1.0 diff --git a/package-lock.json b/package-lock.json index f8a314c..ac2b260 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5349,7 +5349,6 @@ "version": "0.1.4", "bundled": true, "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -5671,8 +5670,7 @@ "is-buffer": { "version": "1.1.6", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "is-builtin-module": { "version": "1.0.0", @@ -5756,7 +5754,6 @@ "version": "3.2.2", "bundled": true, "dev": true, - "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -5803,8 +5800,7 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "lru-cache": { "version": "4.1.3", @@ -6070,8 +6066,7 @@ "repeat-string": { "version": "1.6.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "require-directory": { "version": "2.1.1", @@ -6888,13 +6883,22 @@ } }, "rollup": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.68.0.tgz", - "integrity": "sha512-UbmntCf8QBlOqJnwsNWQCI0oonHOgs9y1OLoO8BHf2r8gCyRLp3JzLHXARJpsNDAS08Qm3LDjzyWma5sqnCxDQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.0.0.tgz", + "integrity": "sha512-LV6Qz+RkuDAfxr9YopU4k5o5P/QA7YNq9xi2Ug2IqOmhPt9sAm89vh3SkNtFok3bqZHX54eMJZ8F68HPejgqtw==", "dev": true, "requires": { "@types/estree": "0.0.39", - "@types/node": "*" + "@types/node": "*", + "acorn": "^6.0.4" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + } } }, "rollup-plugin-babel": { diff --git a/package.json b/package.json index dc41a63..6943d5e 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "mocha": "^5.0.0", "nyc": "^13.0.1", "rimraf": "^2.6.2", - "rollup": "^0.68.0", + "rollup": "^1.0.0", "sourcemap-validator": "^1.0.6" }, "config": { diff --git a/src/index.js b/src/index.js index ae68ca7..19b0566 100644 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,7 @@ function minify( options = {} ) { return { name: 'babel-minify', - transformBundle( bundle, { banner: bundleBanner } ) { + renderChunk( bundle, chunkInfo, { banner: bundleBanner } ) { const minifyOptions = filterMinifyOptions( options ); const babelConf = { presets: [ [ minifyPreset, minifyOptions ] ], diff --git a/tests/cli.js b/tests/cli.js index 67e0c30..1c1a10b 100644 --- a/tests/cli.js +++ b/tests/cli.js @@ -53,18 +53,4 @@ describe( 'Rollup CLI', () => { } ).not.to.throw(); } ); } ); - - it( 'banner inherited (legacy syntax)', () => { - return executeRollupCmd( 'bannerInheritLegacy' ).then( () => { - assertArtifacts(); - - const { [ 'bundle.js' ]: code, [ 'bundle.js.map' ]: map } = getArtifacts(); - - expect( code ).to.match( /^\/\* hublabubla \*\// ); - expect( map ).to.not.equal( null ); - expect( () => { - validateSourcemap( code, map ); - } ).not.to.throw(); - } ); - } ); } ); diff --git a/tests/fixtures/simple-project/rollup.config.bannerInheritLegacy.js b/tests/fixtures/simple-project/rollup.config.bannerInheritLegacy.js deleted file mode 100644 index ae1f443..0000000 --- a/tests/fixtures/simple-project/rollup.config.bannerInheritLegacy.js +++ /dev/null @@ -1,14 +0,0 @@ -import minify from '../../../dist/rollup-plugin-babel-minify.es2015.js'; - -export default { - input: 'index.js', - plugins: [ - minify() - ], - banner: '/* hublabubla */', - output: { - sourcemap: true, - file: 'bundle.js', - format: 'es' - } -}; diff --git a/tests/helpers/createTransformTest.js b/tests/helpers/createTransformTest.js index f91c062..0087e65 100644 --- a/tests/helpers/createTransformTest.js +++ b/tests/helpers/createTransformTest.js @@ -35,7 +35,7 @@ function createTransformTest( { return rollup( rollupOptions ).then( ( bundle ) => { return bundle.generate( bundleOptions ); - } ).then( ( result ) => { + } ).then( ( { output: [ result ] } ) => { return { bundle: result, transpiled: babeledCode