Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Export webpack function in typescript

The webpack docs show the type to be return from configuration function, but not the types of the parameters env and argv. Currently I've to type them as any, however what are the actual types of env and argv?

const configuration = (env: any, argv: any): Configuration => ({
  mode: 'production',
  entry: './foo.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'foo.bundle.js',
  },
  ...
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

They are both any because they are both coming from the webpack cli arguments, so it is not possible to know the type in advance at compile time (unless you strictly know that you will always pass certain arguments and force the type to be what you declare it to be)

Webpack Environment Variables docs may help to understand better.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!