parent
16505edb5e
commit
5afe082cad
@ -1,11 +1,48 @@
|
||||
import { readFileSync } from "fs";
|
||||
import { builtinModules } from "module";
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
|
||||
import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
const input = "guest-js/index.ts";
|
||||
const pkg = JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
);
|
||||
const external = [/^@tauri-apps\/api/];
|
||||
|
||||
export default [
|
||||
{
|
||||
input,
|
||||
external: Object.keys(pkg.dependencies || {})
|
||||
.concat(Object.keys(pkg.peerDependencies || {}))
|
||||
.concat(builtinModules)
|
||||
.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