-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.js
86 lines (74 loc) · 1.89 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
const autoprefixer = require('autoprefixer'),
webpack = require('webpack'),
path = require('path');
const {resolve} = path;
const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
const BUILD_DIR = resolve(__dirname, 'build'),
APP_DIR = resolve(__dirname, 'app'),
ASSETS_DIR = '/assets',
OUTPUT_FILE = 'bundle.js',
ENTRY_FILE = resolve(APP_DIR, 'entry.js'),
HOST_NAME = 'localhost', // <-- will be on local network
PORT = 5000;
module.exports = {
entry: [
'tether',
'font-awesome-loader',
bootstrapEntryPoints.dev,
ENTRY_FILE
],
output: {
path: BUILD_DIR,
filename: OUTPUT_FILE,
publicPath: ASSETS_DIR
},
devtool: 'source-map',
devServer: {
inline: true,
contentBase: BUILD_DIR,
host: HOST_NAME,
port: PORT
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
'postcss-loader'
]
}, {
test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']
}, {
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: 'url-loader?limit=10000',
}, {
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
use: 'file-loader',
}, {
test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'
}, {
test: /\.jsx?$/,
include: APP_DIR,
exclude: /(node_modules)|(bower_components)/,
loader: 'babel-loader'
}]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
'window.Tether': 'tether',
}),
new webpack.LoaderOptionsPlugin({
postcss: [autoprefixer],
}),
]
};