Skip to content

Latest commit

 

History

History

demo_app-gulp

ExternalAssetPipeline Demo with Gulp and Webpack replacing Sprockets

This example uses gulp with gulp-rev and webpack with webpack-assets-manifest to build the assets and generate the manifest. Refer to the package.json, gulp tasks, and webpack.config.js to see the specifics.

In this example, sprockets has been completely removed. Thus, there's no more assets:precompile rake task, and in fact, there's no need to install gems, load the rails environment, or even have ruby installed to compile assets - the app's asset compilation is completely decoupled from rails! When that coupling exists, changes to ruby code may affect assets, but when they're completely separate, that's guaranteed to not be the case. Thus, we can easily determine when it's unnecessary to recompile assets and use that to reduce the overall build time.

Working with assets

Watch mode (incremental recompilation)

bin/yarn watch

Development build

bin/yarn build

Production build

NODE_ENV=production bin/yarn build