1 | # @rollup/plugin-strip
|
2 |
|
3 | Remove `debugger` statements and functions like `assert.equal` and `console.log` from your code.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```bash
|
8 | npm install --save-dev @rollup/plugin-strip
|
9 | ```
|
10 |
|
11 | ## Usage
|
12 |
|
13 | ```js
|
14 | // rollup.config.js
|
15 | import strip from '@rollup/plugin-strip';
|
16 |
|
17 | export default {
|
18 | input: 'src/index.js',
|
19 | output: [
|
20 | {
|
21 | format: 'cjs',
|
22 | file: 'dist/my-lib.js'
|
23 | }
|
24 | ],
|
25 | plugins: [
|
26 | strip({
|
27 | // set this to `false` if you don't want to
|
28 | // remove debugger statements
|
29 | debugger: true,
|
30 |
|
31 | // defaults to `[ 'console.*', 'assert.*' ]`
|
32 | functions: ['console.log', 'assert.*', 'debug', 'alert'],
|
33 |
|
34 | // remove one or more labeled blocks by name
|
35 | // defaults to `[]`
|
36 | labels: ['unittest'],
|
37 |
|
38 | // set this to `false` if you're not using sourcemaps –
|
39 | // defaults to `true`
|
40 | sourceMap: true
|
41 | })
|
42 | ]
|
43 | };
|
44 | ```
|
45 |
|
46 | ## License
|
47 |
|
48 | MIT
|