feat(rollup): Don't use terser to minify code
Just ship code as-is, let bundlers take care of it. Closes #697
This commit is contained in:
parent
a32ac826ce
commit
c0e61756cb
1 changed files with 4 additions and 7 deletions
|
@ -1,20 +1,22 @@
|
||||||
import resolve from '@rollup/plugin-node-resolve'
|
import resolve from '@rollup/plugin-node-resolve'
|
||||||
import commonjs from '@rollup/plugin-commonjs'
|
import commonjs from '@rollup/plugin-commonjs'
|
||||||
import json from '@rollup/plugin-json'
|
import json from '@rollup/plugin-json'
|
||||||
import { terser } from 'rollup-plugin-terser'
|
|
||||||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
||||||
import { name, version, description, author, license, main, module, rollup } from './package.json'
|
import { name, version, description, author, license, main, module, rollup } from './package.json'
|
||||||
|
|
||||||
|
const banner = `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||||
const output = [
|
const output = [
|
||||||
{
|
{
|
||||||
|
banner
|
||||||
file: main,
|
file: main,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
exports: rollup.exports
|
exports: rollup.exports,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
if (typeof module !== 'undefined')
|
if (typeof module !== 'undefined')
|
||||||
output.push({
|
output.push({
|
||||||
|
banner
|
||||||
file: module,
|
file: module,
|
||||||
format: 'es',
|
format: 'es',
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
|
@ -28,10 +30,5 @@ export default {
|
||||||
resolve({ modulesOnly: true }),
|
resolve({ modulesOnly: true }),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
json(),
|
json(),
|
||||||
terser({
|
|
||||||
output: {
|
|
||||||
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue