2017-12-30 13:37:28 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
2018-01-21 03:56:05 +00:00
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
2017-12-30 13:37:28 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2018-07-18 07:52:37 +00:00
|
|
|
mode: process.env['BROWSH_ENV'] === 'RELEASE' ? 'production' : 'development',
|
2018-02-01 07:37:38 +00:00
|
|
|
target: 'node',
|
2017-12-30 13:37:28 +00:00
|
|
|
entry: {
|
|
|
|
content: './content.js',
|
|
|
|
background: './background.js'
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: __dirname,
|
|
|
|
filename: 'dist/[name].js',
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: [
|
|
|
|
path.resolve(__dirname, './src'),
|
|
|
|
'node_modules'
|
|
|
|
]
|
|
|
|
},
|
2018-07-18 07:52:37 +00:00
|
|
|
devtool: 'source-map',
|
2017-12-30 13:37:28 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2018-01-01 14:10:10 +00:00
|
|
|
DEVELOPMENT: JSON.stringify(true),
|
2018-04-18 13:11:04 +00:00
|
|
|
TEST: JSON.stringify(false),
|
|
|
|
// TODO: For production use a different webpack.config.js
|
2018-01-01 14:10:10 +00:00
|
|
|
PRODUCTION: JSON.stringify(false)
|
2018-01-21 03:56:05 +00:00
|
|
|
}),
|
|
|
|
new CopyWebpackPlugin([
|
|
|
|
{ from: 'assets', to: 'dist/assets' },
|
|
|
|
{ from: 'manifest.json', to: 'dist/' },
|
|
|
|
{ from: '.web-extension-id', to: 'dist/' },
|
|
|
|
])
|
2018-01-12 13:58:32 +00:00
|
|
|
]
|
2017-12-30 13:37:28 +00:00
|
|
|
};
|