mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-21 20:59:20 +00:00
build: separate sveld into a separate build script
This commit is contained in:
parent
1aa6e0c110
commit
28fd09f0c9
3 changed files with 21 additions and 19 deletions
|
@ -16,6 +16,7 @@
|
||||||
"test:preprocess": "node tests/preprocess",
|
"test:preprocess": "node tests/preprocess",
|
||||||
"build:css": "node scripts/build-css",
|
"build:css": "node scripts/build-css",
|
||||||
"build:api": "node scripts/build-api",
|
"build:api": "node scripts/build-api",
|
||||||
|
"build:docs": "node scripts/build-docs",
|
||||||
"build:lib": "rollup -c",
|
"build:lib": "rollup -c",
|
||||||
"prepack": "run-p build:*",
|
"prepack": "run-p build:*",
|
||||||
"format": "prettier --write \"./**/*.{svelte,js,md}\""
|
"format": "prettier --write \"./**/*.{svelte,js,md}\""
|
||||||
|
|
|
@ -3,7 +3,6 @@ import pkg from "./package.json";
|
||||||
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 svelte from "rollup-plugin-svelte";
|
import svelte from "rollup-plugin-svelte";
|
||||||
import sveld from "sveld";
|
|
||||||
|
|
||||||
export default ["es", "umd"].map((format) => {
|
export default ["es", "umd"].map((format) => {
|
||||||
const UMD = format === "umd";
|
const UMD = format === "umd";
|
||||||
|
@ -23,24 +22,6 @@ export default ["es", "umd"].map((format) => {
|
||||||
resolve(),
|
resolve(),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
UMD && terser(),
|
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",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
20
scripts/build-docs.js
Normal file
20
scripts/build-docs.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
const { sveld } = require("sveld");
|
||||||
|
const pkg = require("../package.json");
|
||||||
|
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue