forked from shakacode/bootstrap-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
81 lines (72 loc) · 2.02 KB
/
webpack.dev.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
/* eslint-disable import/no-extraneous-dependencies */
// Very similar to webpack.prod.config.js. Common parts could be extracted to a base config.
// See example at:
// https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client%2Fwebpack.client.base.config.js
const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
// eslint-disable-next-line no-console
console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
module.exports = {
entry: [
'webpack-hot-middleware/client',
'tether',
'font-awesome-loader',
bootstrapEntryPoints.dev,
'./app/startup/App',
],
output: {
path: path.join(__dirname, 'public', 'assets'),
filename: 'app.js',
publicPath: '/assets/',
},
devtool: '#cheap-module-eval-source-map',
resolve: { extensions: ['*', '.js', '.jsx'] },
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
'window.Tether': 'tether',
$: "jquery",
jQuery: "jquery"
}),
new webpack.LoaderOptionsPlugin({
postcss: [autoprefixer],
}),
],
module: {
rules: [
{
test: /\.jsx?$/,
use: ['babel-loader'],
exclude: /node_modules/,
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]',
'postcss-loader',
],
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader?modules&importLoaders=2&localIdentName=[name]__[local]__[hash:base64:5]',
'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',
},
],
},
};