What is this garbage? you say, staring into the void of this repository.
Well, my friend, this garbage is a boilerplate featuring Browserify and Modular CSS!
A while back I wrote a boilerplate that used Webpack and allowed you to bundle your scripts in such a way that you wouldn't hate your life setting up a build process.
This is much the same, but it has a few opinions.
Pretty simple, actually!
npm installfor grabbing the dependencies.npm run buildto output your bundled scripts into thedistdirectory.npm run serveto watch your files, rebuild on save, and also run a server at:3000- This also starts a filewatcher that will automatically reload the browser you're viewing your app in when changes are detected in parts of the
srcordistdirectory.
- This also starts a filewatcher that will automatically reload the browser you're viewing your app in when changes are detected in parts of the
npm run lintto run a fine-toothed comb through it via Eslint.
-
Browserify - It uses browserify to bundle stuff, and a few plugins to help you develop faster, namely
watchifyfor compile-on-save -
Modular CSS - Modular CSS because back in the day when I tried React.js, I was using js style properties and hooking them into a
styleattribute on a virtual dom element. This is a much cleaner, more familiar way of approaching that same obstacle. -
Eslint - Because whatever dude, why don't you fight me about linting my code? It's currently set to use the Google preset, but you can just as easily change that by
npm installing your favorite preset. -
Mithril.js - Yes, this comes with Mithril. I included it simply because I think this sort of workflow is ideal for a virtual DOM library. You're free to swap it out for any Virtual DOM library of your choice. Maybe you're going to go rogue and you don't NEED a virtual DOM library, but honestly that's one of the things that makes Modular CSS so good in this build. You don't need a Virtual DOM? GET OUTTA HERE.
If I dropped the ball on anything here, please, let me know! Submit a PR! Help me make this great! :D