Skip to content

Commit

Permalink
fix eslint-import requires
Browse files Browse the repository at this point in the history
include assets
  • Loading branch information
vdiez committed Nov 12, 2024
1 parent 3239be4 commit 065a533
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 1,021 deletions.
18 changes: 18 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import esbuild from 'esbuild';
import textReplace from 'esbuild-plugin-text-replace';
import { copy } from 'esbuild-plugin-copy';

await esbuild.build({
entryPoints: ['./bin/server.mjs'],
Expand All @@ -18,6 +19,23 @@ await esbuild.build({
[/const babelParser = require.*\}\)\)/gms, 'const babelParser = require("@babel/parser")'],
['const espreePath = require.resolve("espree");', ''],
['config.parser = espreePath;', ''],
[
'tryRequire(`eslint-import-resolver-${name}`, sourceFile)',
'require("eslint-import-resolver-node")',
],
],
}),
copy({
resolveFrom: 'cwd',
assets: [
{
from: ['./node_modules/typescript/lib/*.d.ts'],
to: ['./build/'],
},
{
from: ['./packages/jsts/src/parsers/estree.proto'],
to: ['./build/'],
},
],
}),
],
Expand Down
Loading

0 comments on commit 065a533

Please sign in to comment.