-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (36 loc) · 1.04 KB
/
webpack.config.js
File metadata and controls
42 lines (36 loc) · 1.04 KB
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
let path = require('path');
let uglify = require('uglifyjs-webpack-plugin');
const SRC_DIR = path.resolve(__dirname, 'public/src');
const OUT_DIR = path.resolve(__dirname, 'public/target');
module.exports = {
entry: {
"journal": path.join(SRC_DIR, "jsx", "JournalApp.jsx"),
"profile": path.join(SRC_DIR, "jsx", "ProfileApp.jsx")
},
output: {
path: OUT_DIR,
filename: "[name].js"
},
plugins: [new uglify()],
module: {
rules: [
// Files ending in .jsx are loaded with babel
{
test: /\.jsx$/,
include: path.join(SRC_DIR, "jsx"),
use: {
loader: 'babel-loader'
}
},
// CSS files are treated as modules
{
test: /\.css$/,
include: path.join(SRC_DIR, "css"),
use: [
{loader: 'style-loader'},
{loader: 'css-loader'}
]
}
]
}
};