parent
593094cc29
commit
d823268b03
@ -1,48 +1,11 @@
|
|||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import { builtinModules } from "module";
|
|
||||||
import typescript from "@rollup/plugin-typescript";
|
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
|
||||||
|
|
||||||
const input = "guest-js/index.ts";
|
import { createConfig } from "../../shared/rollup.config.mjs";
|
||||||
const pkg = JSON.parse(
|
|
||||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
|
||||||
);
|
|
||||||
const external = [/^@tauri-apps\/api/];
|
|
||||||
|
|
||||||
export default [
|
export default createConfig({
|
||||||
{
|
input: "guest-js/index.ts",
|
||||||
input,
|
pkg: JSON.parse(
|
||||||
external: Object.keys(pkg.dependencies || {})
|
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||||
.concat(Object.keys(pkg.peerDependencies || {}))
|
),
|
||||||
.concat(builtinModules)
|
external: [/^@tauri-apps\/api/],
|
||||||
.concat(external),
|
});
|
||||||
onwarn: (warning) => {
|
|
||||||
throw Object.assign(new Error(), warning);
|
|
||||||
},
|
|
||||||
strictDeprecations: true,
|
|
||||||
output: {
|
|
||||||
file: pkg.module,
|
|
||||||
format: "es",
|
|
||||||
sourcemap: true,
|
|
||||||
},
|
|
||||||
plugins: [typescript({ sourceMap: true })],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input,
|
|
||||||
onwarn: (warning) => {
|
|
||||||
throw Object.assign(new Error(), warning);
|
|
||||||
},
|
|
||||||
strictDeprecations: true,
|
|
||||||
output: {
|
|
||||||
file: pkg.browser,
|
|
||||||
format: "es",
|
|
||||||
sourcemap: true,
|
|
||||||
entryFileNames: "[name].min.js",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
resolve(),
|
|
||||||
// terser(),
|
|
||||||
typescript({ sourceMap: true }),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
Loading…
Reference in new issue