Skip to content

Commit

Permalink
Minify js in production.
Browse files Browse the repository at this point in the history
The rake asset compilation task will now run the production-specific
npm build scripts.
  • Loading branch information
lukeasrodgers committed Feb 19, 2016
1 parent 495956c commit cc9fafc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions client/webpack.client.rails.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ if (devBuild) {
console.log('Webpack dev build for Rails'); // eslint-disable-line no-console
config.devtool = 'eval-source-map';
} else {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin()
);
console.log('Webpack production build for Rails'); // eslint-disable-line no-console
}

Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace :assets do

desc "Compile assets with webpack"
task :webpack do
sh "cd client && npm run build:client"
sh "cd client && npm run build:server"
sh "cd client && npm run build:production:client"
sh "cd client && npm run build:production:server"
sh "mkdir -p public/assets"

# Critical to manually copy non js/css assets to public/assets as we don't want to fingerprint them
Expand Down

0 comments on commit cc9fafc

Please sign in to comment.