-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.common.config.js
56 lines (54 loc) · 1.26 KB
/
webpack.common.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
const path = require('path');
const webpack = require('webpack');
require('dotenv').config();
module.exports = {
entry: {
app: path.resolve(__dirname, './client/src/app.js'),
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, './client/dist'),
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
'process.env.UPLOAD_PRESET': JSON.stringify(process.env.UPLOAD_PRESET),
'process.env.API_KEY': JSON.stringify(process.env.API_KEY),
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default'],
}),
],
module: {
rules: [
{
test: /\js?$/,
loader: 'babel-loader',
query: {
presets: ['stage-2', 'react', 'env'],
plugins: ['transform-class-properties'],
},
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: [
{
loader: 'url-loader',
options: { limit: 10000 },
},
],
},
],
},
};