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

Wrong cli flags when set mainFields in JS API #440

Closed
yoyo930021 opened this issue Oct 8, 2020 · 0 comments · Fixed by #441
Closed

Wrong cli flags when set mainFields in JS API #440

yoyo930021 opened this issue Oct 8, 2020 · 0 comments · Fixed by #441

Comments

@yoyo930021
Copy link
Contributor

yoyo930021 commented Oct 8, 2020

await service.build({
  entryPoints: [getServerURL('src/main.ts')],
  outfile: getServerURL('dist/vls.js'),
  minify: true,
  bundle: true,
  sourcemap: true,
  platform: 'node',
  mainFields: ['module,main'],
  target: 'es2018',
  external: ['vscode', 'eslint-plugin-vue', 'stylus', 'eslint'],
  format: 'cjs',
  tsconfig: getServerURL('tsconfig.json')
})
Error: Build failed with 2 errors:
error: Invalid file extension: "main"
error: Invalid file extension: "module"
    at failureErrorWithLog (/Users/yoyo930021/git/vetur/node_modules/esbuild/lib/main.js:628:15)
    at /Users/yoyo930021/git/vetur/node_modules/esbuild/lib/main.js:492:31
    at handleIncomingPacket (/Users/yoyo930021/git/vetur/node_modules/esbuild/lib/main.js:474:9)
    at Socket.readFromStdout (/Users/yoyo930021/git/vetur/node_modules/esbuild/lib/main.js:417:7)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
@yoyo930021 yoyo930021 changed the title Wrong flags when mainFields: ['module', 'main'] in JS API Wrong cli flags when mainFields: ['module', 'main'] in JS API Oct 8, 2020
yoyo930021 added a commit to yoyo930021/esbuild that referenced this issue Oct 8, 2020
@yoyo930021 yoyo930021 changed the title Wrong cli flags when mainFields: ['module', 'main'] in JS API Wrong cli flags when set mainFields in JS API Oct 8, 2020
@evanw evanw closed this as completed in #441 Oct 8, 2020
evanw added a commit that referenced this issue Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant