Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
JavaScript by Example

You're reading from   JavaScript by Example Learn modern web development with real-world applications

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher Packt
ISBN-13 9781788293969
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dani Akash S Dani Akash S
Author Profile Icon Dani Akash S
Dani Akash S
Arrow right icon
View More author details
Toc

Generating a production build

You might have noticed something about both the Meme Creator and the Event Registration apps. The apps load plain HTML first; after that, styles are loaded. This makes the applications look plain for a moment. This problem does not exist in the ToDo List app because we load CSS first in the ToDo List app. In the Meme Creator app, there was an optional section called Optimizing Webpack builds for different environments. This might be a good time to read it. If you haven't read it yet, go back, give that section a read, and come back to generate the production build.

So far, our app has been working in a development environment. Remember? In the .env file, I told you to set NODE_ENV=dev. This is because, when you set NODE_ENV=production as per the webpack.config.js file I created, Webpack will go into production mode. The npm run watch command...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime