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

fix: removes module export #9

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@
"vite-plugin",
"vite-plugin-graphql-codegen"
],
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
Expand Down
11 changes: 10 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ export default defineConfig({
sourcemap: true,
clean: true,
skipNodeModulesBundle: true,
format: ['cjs', 'esm'],
format: ['cjs'],
esbuildOptions: (options) => {
options.footer = {
// This will ensure we can continue writing this plugin
// as a modern ECMA module, while still publishing this as a CommonJS
// library with a default export, as that's how ESLint expects plugins to look.
// @see https://github.com/evanw/esbuild/issues/1182#issuecomment-1011414271
js: 'module.exports = module.exports.default;',
};
},
});