-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
29 lines (26 loc) · 845 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
29 lines (26 loc) · 845 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
const path = require("path");
const DEV_ENV = "development";
const PROD_ENV = "production";
const ENV = process.env.NODE_ENV || DEV_ENV;
const devtool = ENV === DEV_ENV ? "#cheap-module-inline-source-map" : "source-maps";
console.log(ENV);
module.exports = {
entry: "./src/index.js",
output: {
filename: "app.js",
path: path.resolve(__dirname, "dist")
},
module: {
rules: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.pegjs$/, loader: "pegjs-loader" },
{ test: /\.css$/, use: [ "style-loader", "css-loader" ] },
{ test: /\.scss$/, use: [ "style-loader", "css-loader", "sass-loader" ] },
]
},
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true
},
devtool
};