2017-12-30 13:37:28 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
content: './content.js',
|
|
|
|
background: './background.js'
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: __dirname,
|
|
|
|
filename: 'dist/[name].js',
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: [
|
|
|
|
path.resolve(__dirname, './src'),
|
|
|
|
'node_modules'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
// TODO: For production use a different webpack.config.js
|
2018-01-01 14:10:10 +00:00
|
|
|
DEVELOPMENT: JSON.stringify(true),
|
|
|
|
PRODUCTION: JSON.stringify(false)
|
2017-12-30 13:37:28 +00:00
|
|
|
})
|
2018-01-10 14:54:51 +00:00
|
|
|
],
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
plugins: [require('babel-plugin-transform-decorators-legacy').default]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2017-12-30 13:37:28 +00:00
|
|
|
};
|