From ea36d8bdde871820ff214021bbfc0e9c04a8e822 Mon Sep 17 00:00:00 2001 From: Nik Nyby Date: Fri, 11 Nov 2022 14:27:35 -0500 Subject: [PATCH] Update terser docs (#4710) The old package isn't compatible with rollup 3.x Co-authored-by: Lukas Taegert-Atkinson --- docs/04-tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/04-tutorial.md b/docs/04-tutorial.md index 022af19686c..887ddb28d9e 100755 --- a/docs/04-tutorial.md +++ b/docs/04-tutorial.md @@ -242,10 +242,10 @@ _Note: Only the data we actually need gets imported – `name` and `devDependenc Some plugins can also be applied specifically to some outputs. See [plugin hooks](guide/en/#build-hooks) for the technical details of what output-specific plugins can do. In a nut-shell, those plugins can only modify code after the main analysis of Rollup has completed. Rollup will warn if an incompatible plugin is used as an output-specific plugin. One possible use-case is minification of bundles to be consumed in a browser. -Let us extend the previous example to provide a minified build together with the non-minified one. To that end, we install `rollup-plugin-terser`: +Let us extend the previous example to provide a minified build together with the non-minified one. To that end, we install `@rollup/plugin-terser`: ``` -npm install --save-dev rollup-plugin-terser +npm install --save-dev @rollup/plugin-terser ``` Edit your `rollup.config.js` file to add a second minified output. As format, we choose `iife`. This format wraps the code so that it can be consumed via a `script` tag in the browser while avoiding unwanted interactions with other code. As we have an export, we need to provide the name of a global variable that will be created by our bundle so that other code can access our export via this variable. @@ -253,7 +253,7 @@ Edit your `rollup.config.js` file to add a second minified output. As format, we ```js // rollup.config.js import json from '@rollup/plugin-json'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; export default { input: 'src/main.js',