browser-plugin-creator
Version:
A modern scaffolding tool for creating browser extensions with ease
48 lines (47 loc) • 1.05 kB
JavaScript
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
popup: './popup.js',
background: './background.js',
content: './content.js',
options: './options.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
clean: true
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|jpg|jpeg|gif|svg)$/,
type: 'asset/resource'
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'manifest.json', to: 'manifest.json' }
]
}),
new HtmlWebpackPlugin({
template: './popup.html',
filename: 'popup.html',
chunks: ['popup']
}),
new HtmlWebpackPlugin({
template: './options.html',
filename: 'options.html',
chunks: ['options']
})
],
devtool: 'source-map'
};