by untog · 12y ago · 0 comments
Also, though I found bower useful I disliked having yet another package manager, yet another manifest and yet another install step included in my development workflow. Using npm for both server and client side modules has been a dream.
That's why I prefer client-side loaders. All you have to do is copy the loader into a folder and create a .html file. I have my dev folder hosted by apache so I don't ever have to worry about starting some process, running npm install and watching it install the entire internet, etc.
Steps like these allow you to systematically control every aspect of the development process, and adapt. In the long run, these steps work in your favor.
They also allow you to hook into the more modern aspects of development. I mean, you don't want to type `npm install` --that's fine; what you're essentially saying is that this incredibly useful ecosystem is irrelevant to your needs. I find that very hard to believe.
Well, that's the beauty of it, for me. I run everything through gulp, so I don't need to remember to run the watch thingy - I type:
gulp watch
which starts up my dev web server, complete with LiveReload shims enabled. Then when I'm ready to build I do gulp dist
and it packages everything up. app.use('/js', browserify('./app/js', {
transform: ['reactify', 'envify'],
extensions: ['.jsx'],
cache: app.get('env') !== 'development',
minify: app.get('env') !== 'development',
gzip: app.get('env') !== 'development',
debug: app.get('env') === 'development',
precompile: ['./app/app.js']
}));
The server will dynamically bundle the JS for you; all you need is to run the server. In our apps, we do this for development, but in the production environment we do the packaging at deploy time (via Google Closure to minify) to create static files that can be served by Nginx.