svelte.sk-auth/rollup.config.js
Dan6erbond 591bfbbbc6
[ENHANCEMENT] Distributable Bundle with Rollup and ESBuild (#11)
* ⚰️ Remove `package-lock.json` to avoid conflicts with Yarn

* ⚰️ Remove `jwt.ts`

* 🏗️ Setup Rollup with entry module `package.json` files and use named exports exclusively for compatibility with CommonJS

* ⬆️ Use `file:..` instead of `link:..` in demo app to test local installation

* 🏷️ Export types as individual files to avoid protected access errors

* 🚨 Explicit `export types`

* 💚 Use ESBuild to bundle with Rollup, update Rollup deps and types

* 🐛 Remove usage of SvelteKit modules

Disable implicitly updating session, routing and getting redirect URL from SvelteKit modules due to missing exports.
2021-05-23 17:32:42 +02:00

29 lines
583 B
JavaScript

import multiInput from "rollup-plugin-multi-input";
import packageJson from "./package.json";
import esbuild from "rollup-plugin-esbuild";
const globals = {
...packageJson.dependencies,
...packageJson.devDependencies,
};
export default [
{
input: ["src/**/*.ts"],
output: {
dir: "dist",
sourcemap: true,
format: "cjs",
},
plugins: [
esbuild(),
multiInput(),
],
external: [
...Object.keys(globals),
"@sveltejs/kit/assets/runtime/app/navigation",
"@sveltejs/kit/assets/runtime/app/stores",
],
},
];