-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
107 lines (105 loc) · 2.45 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
98
99
100
101
102
103
104
105
106
107
const path = require('path');
const webpack = require('webpack');
const config = require('./app.config');
module.exports = {
devtool: 'eval-source-map',
entry: [
'react-hot-loader/patch',
'webpack-hot-middleware/client',
path.resolve('src/index.js')
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, ''),
publicPath: '/'
},
module: {
rules: [
{
test: /\.jsx?/,
// Don't use .babelrc in `yarn link`-ed dependency's directory and use in current direction instead
loader: 'babel-loader?babelrc=false&extends=' + path.resolve(__dirname, '.babelrc')
},
{
test: /\.js?/,
exclude: [/node_modules/, /public/],
use: [
"babel-loader",
{
loader: 'eslint-loader',
options: {
emitError: true
}
}
]
},
{
test: /\.test.js?/,
exclude: [/node_modules/, /public/],
use: [
"babel-loader",
{
loader: 'eslint-loader',
options: {
emitError: true
}
}
]
},
{
test: /\.css$/,
use: [
'style-loader',
//{ loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[name]__[local]___[hash:base64:5]' } }, CSS Modules disabled to allow Bootstrap 4
{ loader: 'css-loader', options: { importLoaders: 1, modules: false } },
'postcss-loader'
]
}
,{
test: /\.scss$/,
use: [
'style-loader',
//{ loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[name]__[local]___[hash:base64:5]' } }, CSS Modules disabled to allow Bootstrap 4
{ loader: 'css-loader', options: { importLoaders: 1, modules: false } },
{ loader: 'postcss-loader', // Run post css actions
options: {
plugins: function () { // post css plugins, can be exported to postcss.config.js
return [
require('precss'),
require('autoprefixer')
];
}
}
},
{ loader: 'sass-loader', options: {
sourceMap: true
}}
]
},
{
// ASSET LOADER
test: /\.(woff|woff2|ttf|eot)$/,
loader: 'file-loader?name=/public/icons/[name].[ext]'
},
{
//IMAGE LOADER
test: /\.(jpe?g|png|gif|svg)$/i,
loader:'file-loader',
options: {
name: '[path][name].[ext]',
// outputPath: path.resolve('src/public/images/'),
// publicPath: '/'
}
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
resolveLoader: {
modules: [
'node_modules'
]
},
externals: config
}