refactor: use new format for packs
This commit is contained in:
parent
4b97bde6d9
commit
032b006dd5
1546 changed files with 70353 additions and 79060 deletions
|
@ -2,14 +2,12 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import livereload from "rollup-plugin-livereload";
|
||||
import styles from "@ironkinoko/rollup-plugin-styles";
|
||||
import { swc } from "rollup-plugin-swc3";
|
||||
|
||||
import { copy } from "@guanghechen/rollup-plugin-copy";
|
||||
|
||||
import { distDirectory, name, sourceDirectory } from "./tools/const.js";
|
||||
import { convertJSONToPack } from "./tools/json-pack-tools.js";
|
||||
|
||||
const staticFiles = [
|
||||
".reuse",
|
||||
|
@ -27,7 +25,6 @@ const staticFiles = [
|
|||
"templates",
|
||||
];
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
const isWatch = process.env.ROLLUP_WATCH === "true";
|
||||
|
||||
/**
|
||||
* @type {import('rollup').RollupOptions}
|
||||
|
@ -59,23 +56,7 @@ const config = {
|
|||
sourceMap: true,
|
||||
minimize: isProduction,
|
||||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{ src: staticFiles, dest: distDirectory },
|
||||
{
|
||||
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}`,
|
||||
},
|
||||
],
|
||||
}),
|
||||
isWatch && livereload(distDirectory),
|
||||
copy({ targets: [{ src: staticFiles, dest: distDirectory }] }),
|
||||
],
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue