Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
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

Building the Meme Creator

We just built a nice little development environment using Webpack. It's time to put it into action. If you have done the production optimizations, make sure you have created the .env file in the project root folder and your NODE_ENV environment variable inside that file is not production. Simply set the value of NODE_ENV=dev while we are working on the application. We are going to build the Meme Creator now. Make sure you have included the memes.js and memes.css files (if you used ExtractTextPlugin) from the dist directory in your index.html file.

Open up the memes.js file in your text editor and keep webpack-dev-server running (npm run watch). Our first step is to create a reference to all the required DOM elements in variables in our class. We can then use the references to modify the elements later, from inside the class. Also, whenever we are...

You have been reading a chapter from
JavaScript by Example
Published in: Aug 2017
Publisher: Packt
ISBN-13: 9781788293969
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 $19.99/month. Cancel anytime
Banner background image