-
Notifications
You must be signed in to change notification settings - Fork 54
/
webpack.config.js
32 lines (29 loc) · 1.03 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
const path = require('path');
module.exports = {
mode: "development",
entry: ['babel-polyfill', path.resolve(__dirname, 'djsr/frontend/src/index.js')],
output: {
// options related to how webpack emits results
// where compiled files go
path: path.resolve(__dirname, "djsr/frontend/static/frontend/public/"),
// 127.0.0.1/static/frontend/public/ where files are served from
publicPath: "/static/frontend/public/",
filename: 'main.js', // the same one we import in index.html
},
module: {
// configuration regarding modules
rules: [
{
// regex test for js and jsx files
test: /\.(js|jsx)?$/,
// don't look in the node_modules/ folder
exclude: /node_modules/,
// for matching files, use the babel-loader
use: {
loader: "babel-loader",
options: {presets: ["@babel/env"]}
},
}
],
},
};