carbon-components-svelte/rollup.config.js
Eric Liu a1e56bd135
Fixes (#749)
* fix(data-table): type DataTableRowId as "any" #530

Fixes #530

* fix(tree-view): make first node focusable if activeId does not match selected

* fix(overflow-menu): set type="button" to prevent default submit behavior #554

Fixes #554

* fix(overflow-menu): update semantic attributes in OverflowMenuItem

* fix(number-input): do not dispatch change event on initialization #561

Fixes #561

* fix(tree-view): make first focusable node tabbable regardless of active/selected states

* fix(date-picker): load rangePlugin dynamically

* build(rollup): enable inlineDynamicImports

* build(rollup): remove "clipboard-copy" global

* fix(overflow-menu): do not render title if using a slot #537

Fixes #537

* fix(select): forward missing focus, input events #501

Fixes #501
2021-07-14 13:48:23 -07:00

46 lines
1.2 KiB
JavaScript

import { terser } from "rollup-plugin-terser";
import pkg from "./package.json";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import svelte from "rollup-plugin-svelte";
import sveld from "sveld";
export default ["es", "umd"].map((format) => {
const UMD = format === "umd";
return {
input: "src",
inlineDynamicImports: true,
output: {
format,
file: UMD ? pkg.main : pkg.module,
name: UMD ? "carbon-components-svelte" : undefined,
globals: { flatpickr: "flatpickr" },
},
external: Object.keys(pkg.dependencies),
plugins: [
svelte({ emitCss: false }),
resolve(),
commonjs(),
UMD && terser(),
UMD &&
sveld({
glob: true,
markdown: true,
markdownOptions: {
onAppend: (type, document, components) => {
if (type === "h1")
document.append(
"quote",
`${components.size} components exported from ${pkg.name}@${pkg.version}.`
);
},
},
json: true,
jsonOptions: {
outFile: "docs/src/COMPONENT_API.json",
},
}),
],
};
});