-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·45 lines (38 loc) · 1.09 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
33
34
35
36
37
38
39
40
41
42
43
44
45
const path = require('path')
module.exports = (env) => {
const isProduction = env === "production";
console.log("env", env)
return {
entry: './src/app.js',
mode: 'none',
node: {
fs: 'empty' //in order to enable fs with webpack
},
output: {
path: path.join(__dirname, 'public', 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
}, {
test: /\.s?css$/,
use: ['style-loader', 'css-loader', 'sass-loader']
}
]
},
devtool: isProduction? 'source-map': 'cheap-module-eval-source-map',
devServer: {
contentBase: path.join(__dirname, 'public'),
historyApiFallback: true,
publicPath: '/dist/'
}
}
}
// console.log(path.join(__dirname, 'public'));
// ABSOLUTE PATH : "/Users/beau/Desktop/deutsche-cards-glossary"
// manifest loader //https://gist.github.com/bronson/163d7d4dde2a845ea3d6af3a0d86d174
// you need to add `import './manifest.json'` to any of your javascript files