Skip to content

Commit

Permalink
build tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Jul 5, 2023
1 parent 8d2cc55 commit 2ec84f8
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/ensjs/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { renameSync } = require('fs')

const base = {
entryPoints: [
...glob.sync('./src/**/!(*.test.ts)', {
...glob.sync('./src/**/!(*.test.ts|types.ts)', {
nodir: true,
ignore: ['./src/@types/**/*', './src/tests/**/*', './src/ABIs/**/*'],
}),
Expand All @@ -29,11 +29,6 @@ esbuild.build({
setup(build) {
build.onResolve({ filter: /.*/ }, (args) => {
if (args.importer) {
if (args.path.match(/^@ethersproject\/.*\//))
return {
path: args.path.replace('/lib/', '/lib.esm/') + '.js',
external: true,
}
if (args.path.startsWith('./') || args.path.startsWith('../'))
return { path: args.path + '.mjs', external: true }
return { path: args.path, external: true }
Expand All @@ -58,11 +53,7 @@ esbuild.build({
setup(build) {
build.onResolve({ filter: /.*/ }, (args) => {
if (args.importer) {
if (
args.path.match(/^@ethersproject\/.*\//) ||
args.path.startsWith('./') ||
args.path.startsWith('../')
)
if (args.path.startsWith('./') || args.path.startsWith('../'))
return { path: args.path + '.js', external: true }
return { path: args.path, external: true }
}
Expand Down

0 comments on commit 2ec84f8

Please sign in to comment.