forked from jpsierens/webpack-react-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.common.config.js
More file actions
53 lines (47 loc) · 1.36 KB
/
webpack.common.config.js
File metadata and controls
53 lines (47 loc) · 1.36 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
'use strict'
const path = require('path')
module.exports = {
resolve: {
alias: {
// Allows `import example from 'components/example';`
'components': path.join(__dirname, 'app/components'),
'routes': path.join(__dirname, 'app/routes'),
'store': path.join(__dirname, 'app/store'),
// Allows sass importing: `@import '~styles/mixins/example';`
'styles': path.join(__dirname, 'app/assets/styles'),
// Allows importing images: `import logo from 'images/logo.png';`
'images': path.join(__dirname, 'app/assets/images'),
// Allows referencing of fonts in css `src: url('fonts/comic-sans.woff');`
'fonts': path.join(__dirname, 'app/assets/fonts')
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
enforce: 'pre',
use: [{loader: 'eslint-loader', options: {rules: {semi: 0}}}],
},
{
test: /\.js?$/,
exclude: /node_modules/,
use: [{loader: 'babel-loader'}]
},
{
test: /\.json?$/,
use: [{loader: 'json-loader'}]
},
{
test: /\.woff(2)?(\?[a-z0-9#=&.]+)?$/,
use: [{loader:
'url-loader?limit=10000&mimetype=application/font-woff'
}]
},
{
test: /\.(ttf|eot|svg)(\?[a-z0-9#=&.]+)?$/,
use: [{loader: 'file-loader'}]
}
]
}
}