forked from TandaHQ/react-hackernews-bootcamp-one-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (48 loc) · 1.21 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
const Path = require('path');
const Autoprefixer = require('autoprefixer');
const Webpack = require('webpack');
//
// Webpack is a javascript application bundling tool. it is used
// to package the applications assets for the web. learn
// more about webpack here https://webpack.js.org
//
const APP_BUILD = Path.resolve(__dirname, 'dist')
const APP_SOURCE = Path.resolve(__dirname, 'source')
const APP_TITLE = 'Hacker News Reader'
const CSS_LOADER = [{
loader: 'style-loader'
}, {
loader: 'css-loader',
options: { modules: true, importLoaders: 1 },
}, {
loader: 'postcss-loader',
options: { plugins: [Autoprefixer()] },
}];
module.exports = {
devtool: 'inline-source-map',
devServer: {
compress: true,
contentBase: APP_BUILD,
historyApiFallback: true,
host: "0.0.0.0",
open: true,
},
entry: APP_SOURCE,
mode: 'development',
output: {
filename: 'bundle.js',
path: APP_BUILD,
},
module: {
rules: [
{ test: /\.(js|jsx)$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.(css)$/, loader: CSS_LOADER },
],
},
plugins: [
new Webpack.NamedModulesPlugin(),
],
resolve: {
extensions: [".jsx", ".js", ".json"],
},
};