refactor: resturcture files so that lincensing info can be bundled properly
This commit is contained in:
parent
699ba74840
commit
1aa284311f
484 changed files with 119 additions and 179 deletions
|
@ -9,14 +9,28 @@ import { terser } from "rollup-plugin-terser";
|
|||
import { distDirectory, name, sourceDirectory } from "./tools/const.js";
|
||||
import { convertJSONToPack } from "./tools/json-pack-tools.js";
|
||||
|
||||
const staticFiles = ["template.json", "system.json", "assets", "fonts", "lang", "templates"];
|
||||
const staticFiles = [
|
||||
".reuse",
|
||||
"assets",
|
||||
"ATTRIBUTION.md",
|
||||
"fonts",
|
||||
"lang",
|
||||
"LICENE.md",
|
||||
"LICENSES",
|
||||
"README.md",
|
||||
"system.json.license",
|
||||
"system.json",
|
||||
"template.json.license",
|
||||
"template.json",
|
||||
"templates",
|
||||
];
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
|
||||
/**
|
||||
* @type {import('rollup').RollupOptions}
|
||||
*/
|
||||
const config = {
|
||||
input: { [`module/${name}`]: `${sourceDirectory}/module/${name}.ts` },
|
||||
input: { [`${name}`]: `${sourceDirectory}/${name}.ts` },
|
||||
output: {
|
||||
dir: distDirectory,
|
||||
format: "es",
|
||||
|
@ -33,13 +47,18 @@ const config = {
|
|||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{ src: staticFiles.map((file) => `${sourceDirectory}/${file}`), dest: distDirectory },
|
||||
{ src: staticFiles, dest: distDirectory },
|
||||
{
|
||||
src: [`${sourceDirectory}/packs/*.json`],
|
||||
src: [`packs/*.json`],
|
||||
dest: `${distDirectory}/packs`,
|
||||
rename: (name) => `${name}.db`,
|
||||
transform: convertJSONToPack,
|
||||
},
|
||||
{
|
||||
src: [`packs/*.json.license`],
|
||||
dest: `${distDirectory}/packs`,
|
||||
rename: (name, extension) => `${name.replace(".json", ".db")}.${extension}`,
|
||||
},
|
||||
],
|
||||
}),
|
||||
isProduction && terser({ ecma: 2020, keep_fnames: true }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue