skinview3d/rollup.config.js

76 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-12-26 03:57:27 +01:00
import { terser } from "rollup-plugin-terser";
2018-08-01 15:52:32 +02:00
import typescript from "rollup-plugin-typescript2";
2019-12-26 03:57:27 +01:00
import resolve from "@rollup/plugin-node-resolve";
2018-08-01 15:52:32 +02:00
import license from "rollup-plugin-license";
const umd = {
format: "umd",
name: "skinview3d",
indent: "\t",
globals: {
"three": "THREE"
}
};
const es = {
format: "es",
indent: "\t"
};
const resolverPlugin = {
name: "resolver",
resolveId: id => id.startsWith("three/src/") ? "three" : undefined
};
const licensePlugin = license({
banner: `
2018-08-01 15:52:32 +02:00
skinview3d (https://github.com/bs-community/skinview3d)
MIT License
`
});
const base = {
input: "src/skinview3d.ts",
external: [
"three"
2018-08-01 15:52:32 +02:00
]
};
export default [
{
...base,
output: [
{ ...umd, file: "dist/skinview3d.js" },
{ ...es, file: "dist/skinview3d.module.js" }
],
plugins: [
resolverPlugin,
resolve(),
typescript(),
licensePlugin
]
},
{
...base,
output: { ...umd, file: "dist/skinview3d.min.js" },
plugins: [
resolverPlugin,
resolve(),
typescript(),
terser(),
licensePlugin
]
},
{
...base,
output: { ...umd, file: "dist/skinview3d.all.js" },
plugins: [
resolve(),
typescript(),
terser(),
licensePlugin
]
}
2018-08-01 15:52:32 +02:00
];