#Partypack
A scaffolding tool for webpack based projects
Boy, I sure hate setting up a build system every single time I want to start a new project. You probably do, too. You probably wish that in the time it took you to set up webpack and a few other bits and bobs that you could actually be developing.
This is a very bare-bones solution for that problem.
Partypack is, again, just a scaffolding for your project. At its core it includes a few minimal things:
- Development config file (for Webpack)
- Production config file (also for Webpack)
- Babel Compiler (in case you're feeling extra ES6-esque or using React)
- Winning enthusiasm (You gotta bring that one, buddy)
Simple! Just make sure of two things:
-
that any/all
.js
files are included in thesrc
directory when you start developing. -
that any code you want to be included in the bundle is referenced in
entry.js
by way ofimport
(ES6) orrequire
(CommonJS).
-
npm run develop
starts your development server atlocalhost:3000
and runs a hot reload whenever you update files in yoursrc
directory -
npm run build-dev
outputs your bundled scripts into thebuild/
folder underbundle.js
-
npm run build-prod
outputs your bundled scripts into thebuild/
folder that are now minified and optimized for your application.
At the end of the day you'll reference your bundle in your HTML like so:
<script src="static/bundle.js"></script>
Note: the file path is static/
instead of build/
because the publicpath
property has been set in our Webpack .config
files. This means that when you run the server, there is no file output in dist
, but the output is used by the running server instance to hot reload
LET'S PARTY.