diff --git a/.travis.yml b/.travis.yml index 8596ab2..85453d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && sudo apt-get install -y nodejs before_script: - - cd lib/assets && npm install && npm run bundle -- -p && cd - + - cd lib/assets && npm install && npm run bundle -- --no-watch && cd - - cp config/database_example.yml config/database.yml - cp config/secrets_example.yml config/secrets.yml - cp config/branding_example.yml config/branding.yml diff --git a/lib/assets/webpack.config.js b/lib/assets/webpack.config.js index 651ba9c..aabea3e 100644 --- a/lib/assets/webpack.config.js +++ b/lib/assets/webpack.config.js @@ -5,6 +5,7 @@ const rootPath = `${__dirname}/../..`; const destPath = `${rootPath}/public`; +const watch = process.argv.indexOf('--no-watch') !== -1; const production = process.argv.indexOf('-p') !== -1; const jsOutputFile = production ? 'javascripts/[name]-[hash].js' : 'javascripts/[name].js'; const cssOutputFile = production ? 'stylesheets/[name]-[hash].css' : 'stylesheets/[name].css'; @@ -97,11 +98,13 @@ }); } }); - this.plugin('done', (stats) => { // Changes value for ASSET_FINGERPRINT hash + this.plugin('done', (stats) => { + // Changes value for ASSET_FINGERPRINT hash const output = `ASSET_FINGERPRINT = "${stats.hash}"`; - fs.writeFileSync(`${rootPath}/config/initializers/fingerprint.rb`, output, 'utf-8'); + fs.writeFileSync(`${rootPath}/config/initializers/fingerprint.rb`, + output, 'utf-8'); }); }, ], - watch: !production, + watch: watch, };