From 392f8ce69b4a519ecfc576e55892cd091b903d7b Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Thu, 20 Aug 2015 23:17:58 +0200 Subject: [PATCH] fix file list for circle deployment, add JS lint * lint will be done in build step and fail with error --- circle.yml | 2 +- client/webpack.local.config.js | 2 +- client/webpack.production.config.js | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/circle.yml b/circle.yml index 28969159f..f1922e685 100644 --- a/circle.yml +++ b/circle.yml @@ -35,7 +35,7 @@ dependencies: - make deps - mkdir -p $(dirname $SRCDIR) - cp -r $(pwd)/ $SRCDIR - - cd $SRCDIR/client; $TOOLS/rebuild-image weaveworks/scope-ui-build . Dockerfile gulpfile.js package.json webpack.config.js .eslintrc + - cd $SRCDIR/client; $TOOLS/rebuild-image weaveworks/scope-ui-build . Dockerfile package.json webpack.production.config.js .eslintrc test: override: diff --git a/client/webpack.local.config.js b/client/webpack.local.config.js index f739e30ec..7d5af0061 100644 --- a/client/webpack.local.config.js +++ b/client/webpack.local.config.js @@ -27,7 +27,7 @@ module.exports = { // This will not actually create a app.js file in ./build. It is used // by the dev server for dynamic hot loading. output: { - path: path.resolve(__dirname, '/build/'), + path: path.join(__dirname, 'build/'), filename: 'app.js', publicPath: 'http://localhost:4041/build/' }, diff --git a/client/webpack.production.config.js b/client/webpack.production.config.js index ba116ff9f..19f7106a2 100644 --- a/client/webpack.production.config.js +++ b/client/webpack.production.config.js @@ -1,18 +1,30 @@ var webpack = require('webpack'); var autoprefixer = require('autoprefixer-core'); +var path = require('path'); /** * This is the Webpack configuration file for production. */ module.exports = { + + // fail on first error when building release + bail: true, + entry: './app/scripts/main', output: { - path: __dirname + '/build/', + path: path.join(__dirname, 'build/'), filename: 'app.js' }, module: { + preLoaders: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'eslint-loader' + } + ], loaders: [ { test: /\.less$/, @@ -36,6 +48,10 @@ module.exports = { }) ], + eslint: { + failOnError: true + }, + resolve: { extensions: ['', '.js', '.jsx'] },