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

317
Views
How webpack dev vs production builds javascript code?

I'm building an HTML web application and writing all my code in TypeScript. I use webpack to convert the TypeScript to JavaScript and to bundle and minify all my individual source files into one javaScript main.js file.

I'd like to know if the main.js file that I'm running in the browser was generated from a development build using webpack or a production build. How can I do this?

For example, in the webpack development config I do:

new webpack.DefinePlugin( {
  IS_DEBUG_MODE: JSON.stringify( true ),
} ),

How can the compiled main.js file use this information to:

console.log( 'isDebugMode', ?? );

I tried doing process.env.IS_DEBUG_MODE but the browser gives me an error stating that process is not defined.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Figured out that I can use the html-webpack-plugin with template parameters to pass information from webpack into html.

https://github.com/jantimon/html-webpack-plugin/tree/main/examples/template-parameters

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!