initial draft
This commit is contained in:
committed by
Manuel Bouza
parent
8ff93423af
commit
c163c23e7e
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user