mirror of
https://github.com/Swatinem/rust-cache
synced 2026-06-10 02:37:12 +00:00
use rollup to do bundle splitting
this uses dynamic imports for the cache provider and should thus solve the deprecated import error when using warpbuild
This commit is contained in:
parent
1fe0a60026
commit
c106961fee
10 changed files with 333200 additions and 665905 deletions
|
|
@ -1,24 +1,11 @@
|
|||
// import * as fs from "node:fs";
|
||||
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import json from "@rollup/plugin-json";
|
||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
||||
import type { RollupWatchOptions } from "rollup";
|
||||
|
||||
// const pkg = JSON.parse(fs.readFileSync("./package.json", { encoding: "utf-8" }));
|
||||
// const external = ["node:module", "node:path", "node:fs", "node:fs/promises", "typescript", "rollup", "@babel/code-frame", "magic-string", "@jridgewell/remapping", "@jridgewell/sourcemap-codec", "convert-source-map"];
|
||||
|
||||
const config: Array<RollupWatchOptions> = [
|
||||
{
|
||||
input: "./.build/src/restore.js",
|
||||
output: { file: "./dist/restore.js", format: "es" },
|
||||
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()],
|
||||
},
|
||||
{
|
||||
input: "./.build/src/save.js",
|
||||
output: { file: "./dist/save.js", format: "es" },
|
||||
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()],
|
||||
},
|
||||
];
|
||||
|
||||
const config: RollupWatchOptions = {
|
||||
input: ["./.build/src/restore.js", "./.build/src/save.js"],
|
||||
output: { dir: "./dist", format: "es" },
|
||||
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()],
|
||||
};
|
||||
export default config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue