initial draft

This commit is contained in:
Tobias Miesel
2018-10-14 13:47:59 +02:00
parent a1b1010c18
commit b6e67cf3db
20 changed files with 25116 additions and 4370 deletions

View File

@@ -1,22 +1,28 @@
const path = require('path')
const ChromeExtensionReloader = require('webpack-chrome-extension-reloader')
module.exports = {
entry: {
content: './src/js/index.js',
background: './src/js/background.js',
options: './src/js/options.js',
popup: './src/js/popup.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
},
output: {
path: path.resolve(__dirname),
filename: 'bundle.js',
filename: '[name].js',
},
plugins: [
new ChromeExtensionReloader({
port: 9090, // Which port use to create the server
reloadPage: true, // Force the reload of the page also
entries: { //The entries used for the content/background scripts
contentScript: 'content', //Use the entry names, not the file name or the path
background: 'background'
}
})
]
// webpack creates sourcemaps by default and evals js code
// this is not allowed by chrome extensions
// https://stackoverflow.com/a/49100966
devtool: 'none'
}