-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
74 lines (68 loc) · 2.26 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var autoprefixer = require("autoprefixer-core");
module.exports = {
devtool: "source-map",
entry: [
"webpack-dev-server/client?http://0.0.0.0:3232",
"webpack/hot/only-dev-server",
"./scripts/index"
],
module: {
// preLoaders: [{
// test: /\.css$/,
// loader: 'csslint'
// },{
// test: /\.jsx?$/,
// // define an include so we check just the files we need
// include: path.resolve(ROOT_PATH, 'app'),
// loader: 'jshint'
// }],
loaders: [{
test: /\.jsx?$/,
loaders: ["react-hot","babel-loader"],
exclude: /node_modules/
},{
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
"style",
"css!sass!autoprefixer?safe=true"
)
}]
},
output: {
path: __dirname + "/build/",
filename: "bundle.js",
publicPath: "/build/"
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin("styles.css"),
],
resolve: {
extensions: ["",".js",".jsx"]
}
};
// ./node_modules/.bin/eslint -v
// Note that like some other tools, such as JSCS and JSHint, ESLint supports package.json based configuration. Simply add a eslintConfig field to it and write the configuration there.
// npm run lint --silent
// ELIFECYCLE
// alias run='npm run --silent' unix
// "lint": "eslint . --ext .js --ext .jsx || true"
// The potential problem with this approach is that in case you
// invoke lint through some other command, it will pass the test
// even if there are failures! In other words if you have another
// script that does something like npm run lint && npm run build,
// it will build regardless of the output of the first command.
// everything
/* eslint-disable */
/* eslint-enable */
// specific rule
/* eslint-disable no-unused-vars */
/* eslint-enable no-unused-vars */
// tweaking a rule
/* eslint no-comma-dangle:1 */
// disable rule per line
// alert('foo'); // eslint-disable-line no-alert