Skip to content

Commit

Permalink
tries to add the js files to index js via import without babel -- thi…
Browse files Browse the repository at this point in the history
…s fails of course
  • Loading branch information
berkeleycole committed Jul 11, 2019
1 parent 2fc385e commit 43553d3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
24 changes: 24 additions & 0 deletions STEP-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Step 3 - Webpack Output

The “output” of webpack is the distribution folder. It is where webpack drops or “outputs” the neat bundles of assets it creates from the individual files we point it to.

We have setup webpack just enough to be performing the most basic function of webpack - creating a dist folder with a main.js file from our entry point. And all of that is great - but none of it is useful yet.

What’s wrong? Let’s take a look:

- The main.js file of our distribution folder contains none of the javascript or other assets we wrote for our webpage.
- The distribution folder has no connection whatsoever to our app. If you start the express server, our app is still functioning exactly the same way it did in part 0.

1. Add our client/js file contents into dist/main.js


2. Create a new index.js file at the address above. For now, it can be mostly empty, with just an alert.




**You have been successful when you see a dist folder in the root of your app**

*Some miscellanious notes:*

- If you run webpack build and in your text editor you see the dist folder, but nothing inside it - it might still be working. Some text editors will hide folders or folder contents like ```dist```. Yeah... that one didn't have me second guessing myself for like 20 min...
3 changes: 3 additions & 0 deletions src/client/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import checkForName from './js/nameChecker'
import formHandler from './js/formHandler'

alert("I EXIST")
2 changes: 2 additions & 0 deletions src/client/js/formHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ function handleSubmit(event) {
document.getElementById('results').innerHTML = res.message
})
}

export { handleSubmit }
2 changes: 2 additions & 0 deletions src/client/js/nameChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ function checkForName(inputText) {
alert("Welcome, Captain!")
}
}

export { checkForName }

0 comments on commit 43553d3

Please sign in to comment.