-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
97 lines (95 loc) · 2.2 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
"use strict";
var path = require("path");
var webpack = require("webpack");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var autoprefixer = require("autoprefixer");
module.exports = {
entry: ["babel-polyfill", path.join(__dirname, "/src/routes.jsx")],
externals: {
KDM_API: JSON.stringify("https://api.thewatcher.io")
},
output: {
path: path.join(__dirname, "/public/"),
filename: "bundle.js",
publicPath: "/"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel",
query: {
cacheDirectory: true,
presets: ["es2015", "react", "stage-2"]
}
},
{
test: /\.jsx$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ["es2015", "react", "stage-2"]
}
},
// {
// test: /\.js$/,
// exclude: /node_modules/,
// loaders: ['babel-loader', 'eslint-loader']
// },
// {
// test: /\.js$/,
// exclude: /node_modules/,
// loaders: ['eslint-loader']
// },
{
test: /\.scss/,
loader: "style-loader!css-loader!postcss-loader!sass-loader"
},
{
test: /\.styl/,
loader: "style-loader!css-loader!stylus-loader"
},
{
test: /\.css$/,
loader: "style-loader!css-loader!postcss-loader"
},
{
test: /\.(png|jpg)$/,
loader: "url-loader?limit=8192"
},
{
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader: "file-loader"
},
{
test: /\.json$/,
loader: "json"
}
]
},
postcss: [autoprefixer({ browsers: ["last 5 versions"] })],
resolve: {
extensions: ["", ".js", ".jsx"]
},
plugins: [
new HtmlWebpackPlugin({
template: "./src/dev-template.html",
inject: false
}),
new webpack.HotModuleReplacementPlugin()
],
devtool: "source-map",
devServer: {
colors: true,
historyApiFallback: true,
contentBase: "./client",
inline: true,
hot: true,
port: 3333
},
eslint: {
configFile: "./.eslintrc",
formatter: require("eslint-friendly-formatter")
}
};