-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
36 lines (36 loc) · 1.06 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
const webpack = require('webpack');
module.exports = {
entry: {
background: './src/background.js',
popup: './src/popup.jsx',
sidebar: './src/sidebar.jsx',
content_scripts: './src/content_script.js',
options_ui: './src/options_ui.jsx',
},
output: {
path: `${__dirname}/`,
filename: '[name]/bundle.js',
},
module: {
rules: [
{ test: /\.css$/, use: 'css-loader' },
{ test: /\.jsx?$/, use: 'babel-loader', exclude: /(node_modules|bower_components)/ },
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
BASE_URL: JSON.stringify(process.env.BASE_URL),
CLIENT_ID: JSON.stringify(process.env.CLIENT_ID),
CLIENT_SECRET: JSON.stringify(process.env.CLIENT_SECRET),
SYNC_INTERVAL: JSON.stringify(process.env.SYNC_INTERVAL),
DATABASE_NAME: JSON.stringify(process.env.DATABASE_NAME),
},
}),
],
devtool: 'source-map',
};