-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
86 lines (79 loc) · 1.79 KB
/
webpack.dev.config.js
File metadata and controls
86 lines (79 loc) · 1.79 KB
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
const path = require('path');
const webpack = require('webpack');
const _config = require('./config');
module.exports = {
devtool: 'eval',
entry: [
path.join(__dirname, '/app/index.js')
],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js',
publicPath: '/public'
},
resolve: {
alias: {
configVariables: path.join(__dirname, 'config-variables.js'),
fxns: path.join(__dirname, 'utils/fxns.js'),
meetupsData: _config.paths.data_path,
prtls: path.join(__dirname, 'app/components/partials'),
style: _config.paths.style_path
},
modules: [
path.join(__dirname, 'node_modules'),
path.join(__dirname, 'style'),
]
},
plugins: [
require('precss'),
require('autoprefixer'),
new webpack.ProvidePlugin({
configVariables: 'configVariables'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
loaders: [
{
test: /\.js?$/,
loader: 'babel-loader',
exclude: path.join(__dirname, 'node_modules')
},
{
test: /\.scss$/,
exclude: /node_modules/,
include: /style/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
sourceMap: true
}
},
{
loader: 'postcss-loader',
options: {
path: 'postcss.config.js',
sourceMap: 'inline',
}
}
]
},
{
test: /\.png$/,
loader: 'file'
},
{
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file'
}
]
},
devServer: {
hot: true
}
}