Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rollup config #4

Open
naporin0624 opened this issue Sep 6, 2022 · 0 comments
Open

rollup config #4

naporin0624 opened this issue Sep 6, 2022 · 0 comments

Comments

@naporin0624
Copy link
Owner

import dts from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";

const config = {
  input: {
    index: "src/index.ts",
    "apollo/index": "src/apollo/index.ts",
    "utils/index": "src/utils/index.ts",
  },
  plugins: [esbuild({ tsconfig: "./tsconfig.json" })],
  output: [
    {
      dir: "lib",
      format: "esm",
      sourcemap: true,
      entryFileNames: "[name].esm.js",
    },
    {
      dir: "lib",
      format: "cjs",
      sourcemap: true,
      entryFileNames: "[name].cjs.js",
    },
  ],
};

const declarationConfig = {
  input: config.input,
  output: [
    {
      dir: "lib",
    },
  ],
  plugins: [dts()],
};

export default [config, declarationConfig];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant