How to setup a Vanilla JS project with Redux


#1

Hi,

I’m getting errors when trying to start a new project with Redux. I want to create a vanilla JS project and am trying to follow along with the egghead tutorials for Redux. No matter how I try to import redux I keep getting this error:
Uncaught ReferenceError: Redux is not defined at client.js: 1

How do I setup a project properly?


#2

Hi Jack,

When you are importing redux are you adding it to package.json or through a CDN into your index.html? If you are adding it to package.json it won’t automatically get into the client.js code, you’ll need to find a way to expose it through your server or require the clientside component through a CDN script link.


#3

Hi thanks for the help… I wanted to do it the “right” way via npm and server.js,but I wasn’t sure.

Seeing as this is just a front end proj, it doesn’t matter that it’s used via CDN. However, my next question is using Babel and ES6/7 features, in particular the spread/rest operator.

I’m not exactly sure how to configure Babel. Could someone please help? --> see project below