diff --git a/package.json b/package.json index 305dd78686..7412b617c8 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "cpy-cli": "^4.2.0", "current-git-branch": "^1.1.0", "esbuild": "^0.18.13", + "esbuild-plugin-file-path-extensions": "^1.0.0", "eslint": "^8.34.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-typescript": "^3.5.5", diff --git a/packages/eslint-plugin-query/tsup.config.js b/packages/eslint-plugin-query/tsup.config.js index 52ba8edb9e..f387586677 100644 --- a/packages/eslint-plugin-query/tsup.config.js +++ b/packages/eslint-plugin-query/tsup.config.js @@ -4,5 +4,5 @@ import { defineConfig } from 'tsup' import { legacyConfig } from '../../scripts/getTsupConfig.js' export default defineConfig([ - legacyConfig({ entry: ['src/*.ts', 'src/*.tsx'], bundle: true }), + legacyConfig({ entry: ['src/*.ts', 'src/*.tsx'] }), ]) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07905cfca1..1a3d436f53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,6 +87,9 @@ importers: esbuild: specifier: ^0.18.13 version: 0.18.13 + esbuild-plugin-file-path-extensions: + specifier: ^1.0.0 + version: 1.0.0 eslint: specifier: ^8.34.0 version: 8.34.0 @@ -8649,6 +8652,11 @@ packages: requiresBuild: true optional: true + /esbuild-plugin-file-path-extensions@1.0.0: + resolution: {integrity: sha512-v5LpSkml+CbsC0+xAaETEGDECdvKp1wKkD4aXMdI4zLjXP0EYfK4GjGhphumt4N+kjR3A8Q+DIkpgxX1XTqO4Q==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: true + /esbuild-plugin-solid@0.4.2(esbuild@0.14.54)(solid-js@1.6.13): resolution: {integrity: sha512-T5GphLoud3RumjeNYO3K9WVjWDzVKG5evlS7hUEUI0n9tiCL+CnbvJh3SSwFi3xeeXpZRrnZc1gd6FWQsVobTg==} peerDependencies: diff --git a/scripts/getTsupConfig.js b/scripts/getTsupConfig.js index 559886c007..28fd7edde9 100644 --- a/scripts/getTsupConfig.js +++ b/scripts/getTsupConfig.js @@ -1,9 +1,10 @@ // @ts-check +import { esbuildPluginFilePathExtensions } from 'esbuild-plugin-file-path-extensions' + /** * @param {Object} opts - Options for building configurations. * @param {string[]} opts.entry - The entry array. - * @param {boolean} [opts.bundle] - Whether to bundle the output. * @returns {import('tsup').Options} */ export function modernConfig(opts) { @@ -12,18 +13,16 @@ export function modernConfig(opts) { format: ['cjs', 'esm'], target: ['chrome91', 'firefox90', 'edge91', 'safari15', 'ios15', 'opera77'], outDir: 'build/modern', - bundle: opts.bundle || false, - splitting: opts.bundle || false, dts: true, sourcemap: true, clean: true, + esbuildPlugins: [esbuildPluginFilePathExtensions({ esmExtension: 'js' })], } } /** * @param {Object} opts - Options for building configurations. * @param {string[]} opts.entry - The entry array. - * @param {boolean} [opts.bundle] - Whether to bundle the output. * @returns {import('tsup').Options} */ export function legacyConfig(opts) { @@ -32,10 +31,9 @@ export function legacyConfig(opts) { format: ['cjs', 'esm'], target: ['es2020', 'node16'], outDir: 'build/legacy', - bundle: opts.bundle || false, - splitting: opts.bundle || false, dts: true, sourcemap: true, clean: true, + esbuildPlugins: [esbuildPluginFilePathExtensions({ esmExtension: 'js' })], } }