Skip to content

Commit

Permalink
Merge pull request #9 from andrew-w-ross/bugfix/undo-es-module
Browse files Browse the repository at this point in the history
fix: removes module export
  • Loading branch information
danielwaltz authored Aug 25, 2022
2 parents 619897e + 1872545 commit f44b5d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
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;',
};
},
});

0 comments on commit f44b5d6

Please sign in to comment.