Skip to content

Commit 7cb2604

Browse files
committed
Enabling ESLint check before Webpack build
1 parent 3cf798b commit 7cb2604

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

build.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
// https://github.com/shelljs/shelljs
2-
// var path = require('path');
31
var ora = require('ora');
42
var webpack = require('webpack');
5-
var webpackConfig = require('./webpack.config');
6-
var spinner = ora('building for production...');
3+
var webpackConfig = require('./webpack.config.js');
4+
var spinner = ora('Building SDK for browser use...');
75

8-
// require('shelljs/global');
96
process.env.NODE_ENV = 'production';
107

118
spinner.start();
129

13-
// var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
14-
// rm('-rf', assetsPath)
15-
// mkdir('-p', assetsPath)
16-
// cp('-R', 'static/', assetsPath)
17-
1810
webpack(webpackConfig, function (err, stats) {
1911
spinner.stop();
2012
if (err) {
2113
throw err;
2214
}
2315
process.stdout.write(stats.toString({
2416
colors: true,
25-
modules: true,
26-
children: true,
27-
chunks: true,
28-
chunkModules: true
17+
modules: false,
18+
children: false,
19+
chunks: false,
20+
chunkModules: false
2921
}) + '\n');
3022
});

dist/kuzzle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/kuzzle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@
2727
"dependencies": {
2828
"bluebird": "3.4.1",
2929
"bufferutil": "^1.2.1",
30-
"eslint-friendly-formatter": "^2.0.6",
31-
"eslint-loader": "^1.5.0",
3230
"node-uuid": "1.4.7",
3331
"ora": "^0.3.0",
3432
"utf-8-validate": "^1.2.1",
3533
"webpack": "^1.13.1",
3634
"ws": "^1.1.1"
3735
},
3836
"devDependencies": {
37+
"eslint": "^2.10.2",
38+
"eslint-friendly-formatter": "^2.0.6",
39+
"eslint-loader": "^1.5.0",
3940
"browserify": "13.1.0",
4041
"codecov": "^1.0.1",
4142
"grunt": "1.0.1",

webpack.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var webpack = require('webpack');
2+
var path = require('path');
23

34
module.exports = {
45
entry: './src/kuzzle.js',
@@ -21,11 +22,11 @@ module.exports = {
2122
},
2223
module: {
2324
noParse: [/wsnode\.js/, /crypto/, /buffer/, /node-uuid/],
24-
preLoaders: [
25+
loaders: [
2526
{
2627
test: /\.js$/,
2728
loader: 'eslint',
28-
include: './src',
29+
include: path.resolve(__dirname, './src/'),
2930
exclude: /node_modules/
3031
}
3132
]
@@ -34,6 +35,7 @@ module.exports = {
3435
formatter: require('eslint-friendly-formatter')
3536
},
3637
plugins: [
38+
new webpack.NoErrorsPlugin(),
3739
new webpack.IgnorePlugin(/wsnode/),
3840
new webpack.optimize.OccurenceOrderPlugin(),
3941
new webpack.DefinePlugin({

0 commit comments

Comments
 (0)