-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-loaders.js
41 lines (39 loc) · 1013 Bytes
/
webpack-loaders.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
"use strict";
const webpack = require('webpack');
const PATHS = require('./webpack-paths');
exports.devServer = function(options) {
return {
devServer:{
historyApiFallback: true,
hot: true, // Enable hot module
inline: true,
stats: 'errors-only',
host: options.host, // http://localhost
port: options.port, // 3000
contentBase: './client/dist',
},
// Enable multi-pass compilation for enhanced performance
plugins: [ // Hot module
new webpack.HotModuleReplacementPlugin({
multistep: true
})
]
};
}
// the css loader
exports.css = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
include: PATHS.css
}
// The file loader
exports.font = {
test: /\.ttf$/,
use: ['file-loader']
}
// Babel loader
exports.babel = {
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader']
};