added additional test code

This commit is contained in:
Christian Svensson
2017-11-16 01:41:40 +01:00
parent fea4f65365
commit 2813d29432
+20 -1
View File
@@ -1,15 +1,25 @@
import { rollup, Bundle } from 'rollup'
import { rollup, Bundle, Plugin } from 'rollup'
let cache: Bundle | undefined
let plugin: Plugin
async function main() {
const bundle = await rollup({
input: 'main.js',
external: ['external-module'],
plugins: [plugin],
cache,
})
const bundle2 = await rollup({
input: 'main.js',
external: id => /^rxjs/.test(id),
plugins: plugin
})
const result = bundle.generate({
format: 'cjs',
indent: false,
})
cache = bundle
@@ -17,6 +27,15 @@ async function main() {
await bundle.write({
format: 'cjs',
dest: 'bundle.js',
globals: {
jquery: '$',
lodash: '_',
},
banner: '/* Banner */',
footer: '/* Footer */',
intro: 'var ENV = "production";',
outro: 'var VERSION = "1.0.0";',
indent: ' ',
})
}