Webpack Flashcards
What is Webpack?
takes a bunch of js files and 3rd party dependencies –> makes 1 file
How do you add a devDependency to a package?
npm install –save-dev packageName
if you don’t do –save-dev it adds to regular dependencies instead of devDependencies
What is an NPM script?
give us shortcut scripts to run other scripts
How do you execute Webpack with npm run?
update package.json “scripts”
npm run build
devDependecies
regular dependency
devDependencies: TOOL used in development process
dependency: project directly uses in code
webpack process
if you change your js code, must run webpack build again (use “npm run watch” command to automate this)
src: contains your js code
main. js: NEVER EDIT THIS; webpack will make this
lib folder
menial tasks for helper functions:
- creating an element
- formatting $
- formatting dates