inline rollup.config.mjs

pull/308/head
Lucas Nogueira 2 years ago
parent 16505edb5e
commit 5afe082cad
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

@ -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";
const input = "guest-js/index.ts";
const pkg = JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
);
const external = [/^@tauri-apps\/api/];
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
),
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…
Cancel
Save