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

Multientry points custom settings error on build #53

Open
PolonioDev opened this issue Apr 24, 2022 · 0 comments
Open

Multientry points custom settings error on build #53

PolonioDev opened this issue Apr 24, 2022 · 0 comments

Comments

@PolonioDev
Copy link

Summary

I'm trying to build my project with multiple entry points, so I use the "input" setting as array and i set "outdir" in my custom config file but ESBuild throws error: Must use "outdir" when there are multiple input files.
Alternatively, i can generate multiple entry points using an array of config objects, but I guess that's not a desired behavior and in the other hand, since "outdir" is not used in esbuild config, if i want to solve it, i must define "outdir" in "buildOptions" object, but we have other problem, it throws error: Cannot use both "outfile" and "outdir" and it doesn't matter if i set "outfile" as undefined, unknown, null or i don't set it, the error goin to be throw.
Keep in mind that, if i define "input" as array i desire that aqu set the "name" of the file as [name].production, [name].development and [name] for the entry, and not [package_name].production, [package_name].development and [package_name] becase each overwrite the last, it would great that Aqu do it by default.

My Settings file.
Context: I am creating an encryption and signature module that includes symmetric and asymmetric methodology and the document or message signature module.

// aqu.config.ts

export default {
  name: '[name]',
  input: [
    './src/index.ts',
    './src/asymmetric.ts',
    './src/symmetric.ts',
    './src/signer.ts',
    './src/types.ts',
    './src/utils.ts'
  ],
  format: ['cjs', 'esm'], // will generate multiple outputs: one for cjs and one for esm
  cjsMode: 'production', // will generate separate files for development and production
  outdir: 'dist', // default output directory
  declaration: 'bundle', // will bundle declarations using https://github.com/timocov/dts-bundle-generator
  externalNodeModules: true, // automatically will mark all node_modules as external
  tsconfig: 'tsconfig.json', // default path to tsconfig
  incremental: true, // will build incrementally
  buildOptions: {}, // custom esbuild options
  watchOptions: {
    // chokidar watch options
    ignored: ['node_modules/**', 'dist/**', 'build/**', 'out/**'], // by default, will ignore those folders
    followSymlinks: false, // will not follow symlinks
  },
};
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

No branches or pull requests

1 participant