forked from la-z/pluck
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (33 loc) · 932 Bytes
/
webpack.config.js
File metadata and controls
35 lines (33 loc) · 932 Bytes
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
const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const SRC_DIR = path.join(__dirname, '/client/src');
const DIST_DIR = path.join(__dirname, '/client/dist');
module.exports = {
entry: `${SRC_DIR}/index.jsx`,
output: {
filename: 'bundle.js',
path: DIST_DIR,
},
module: {
rules: [
{ test: /\.jsx?/, use: 'babel-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
],
},
mode: 'development',
plugins: [new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
KEY: JSON.stringify('sk.eyJ1IjoiYXNwMjEzMSIsImEiOiJjanNnZG1tcTAwOWdtNDlwNnQwdWl2dXY4In0.DDGPSnlet8J43DnO9G7lEw')
},
}),
new HtmlWebPackPlugin({
template: 'client/src/index.html',
}),
],
node: {
fs: 'empty',
},
};