-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (35 loc) · 925 Bytes
/
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
33
34
35
36
37
const path = require('path');
const paths = require("./config/paths");
const dotenv = require('dotenv');
const webpack = require('webpack')
console.log(paths)
module.exports = {
mode: 'development',
entry: [paths.src + '/js/main.js'],
output: {
path: paths.build,
filename: "js/main-bundled.js",
},
module: {
rules: [
{
test: /\.hbs$/,
loader: 'handlebars-loader',
options: {
helperDirs: path.resolve(__dirname, "./src/helpers"),
partialDirs: path.resolve(__dirname, "./src/partials"),
utilMethodDirs: path.resolve(__dirname, "./src/js/jshelper")
}
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': JSON.stringify(dotenv.config().parsed) // it will automatically pick up key values from .env file
})
]
};