mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
add webpack to organize code
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
const path = require('path');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'SEQTA': './src/SEQTA.js',
|
||||
'background': './src/background.js',
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'build'),
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
include: path.resolve(__dirname, 'src'),
|
||||
},
|
||||
{
|
||||
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: 'src/[path][name][ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: 'public', to: '.' }, // Copies everything from the public folder to the root level of build
|
||||
{ from: 'src/inject', to: 'inject' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user