-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
45 lines (42 loc) · 1.09 KB
/
Copy pathwebpack.dev.js
File metadata and controls
45 lines (42 loc) · 1.09 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
43
44
45
'use strict';
require('dotenv').config();
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: path.resolve(process.cwd(), './src/ui/index.js'),
output: {
path: path.resolve(process.cwd(), './build'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader',
},
],
},
plugins: [
new webpack.DefinePlugin({
FIREBASE_API_KEY: JSON.stringify(process.env.FIREBASE_API_KEY),
FIREBASE_AUTH_DOMAIN: JSON.stringify(process.env.FIREBASE_AUTH_DOMAIN),
FIREBASE_DATABASE_URL: JSON.stringify(process.env.FIREBASE_DATABASE_URL),
FIREBASE_STORAGE_BUCKET: JSON.stringify(process.env.FIREBASE_STORAGE_BUCKET),
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.js',
}),
],
watchOptions: {
ignored: /node_modules/,
},
devtool: 'inline-source-map',
devServer: {
historyApiFallback: true,
contentBase: path.join(process.cwd(), 'build'),
compress: true,
port: 9966,
},
};