added rollup-plugin-analyzer to retrieve useful information when building
This commit is contained in:
parent
e59ff93b1d
commit
da657bbdcc
6
package-lock.json
generated
6
package-lock.json
generated
@ -640,6 +640,12 @@
|
|||||||
"acorn": "^7.1.0"
|
"acorn": "^7.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rollup-plugin-analyzer": {
|
||||||
|
"version": "3.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/rollup-plugin-analyzer/-/rollup-plugin-analyzer-3.2.3.tgz",
|
||||||
|
"integrity": "sha512-Oq5GtofTCIGhW4mDNtnxH106gvPKQcdAKTLujWekAiLiTmstXX9Fmye7uMG7NaZVBHgKPPsIWCtPj04ci/YXmg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"rollup-plugin-terser": {
|
"rollup-plugin-terser": {
|
||||||
"version": "5.3.0",
|
"version": "5.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz",
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
"@rollup/plugin-replace": "^2.3.2",
|
"@rollup/plugin-replace": "^2.3.2",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"rollup": "^1.27.0",
|
"rollup": "^1.27.0",
|
||||||
|
"rollup-plugin-analyzer": "^3.2.3",
|
||||||
"rollup-plugin-terser": "^5.0.0"
|
"rollup-plugin-terser": "^5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import resolve from '@rollup/plugin-node-resolve'
|
import resolve from '@rollup/plugin-node-resolve'
|
||||||
|
import { terser } from 'rollup-plugin-terser'
|
||||||
import commonjs from '@rollup/plugin-commonjs'
|
import commonjs from '@rollup/plugin-commonjs'
|
||||||
import replace from '@rollup/plugin-replace'
|
import replace from '@rollup/plugin-replace'
|
||||||
import alias from '@rollup/plugin-alias'
|
import alias from '@rollup/plugin-alias'
|
||||||
import { terser } from 'rollup-plugin-terser'
|
import analyze from 'rollup-plugin-analyzer'
|
||||||
|
|
||||||
// 'rollup -c' -> 'production' is false
|
// 'rollup -c' -> 'production' is false
|
||||||
// 'rollup -c -w' -> 'production' is true
|
// 'rollup -c -w' -> 'production' is true
|
||||||
@ -32,6 +33,7 @@ export default {
|
|||||||
}),
|
}),
|
||||||
resolve(), // Tells Rollup how to find imported modules in node_modules
|
resolve(), // Tells Rollup how to find imported modules in node_modules
|
||||||
commonjs(), // Converts imported modules to ES modules, if necessary
|
commonjs(), // Converts imported modules to ES modules, if necessary
|
||||||
production && terser() // Minify, but only in production
|
production && terser(), // Minify, but only in production
|
||||||
|
production && analyze({ showExports: true }) // Show useful information about bundles, only in production
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user