33 lines
831 B
JavaScript
33 lines
831 B
JavaScript
const path = require('path');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
module.exports = {
|
|
mode: 'production',
|
|
entry: {
|
|
background: './src/background/index.ts',
|
|
content: './src/content/index.ts',
|
|
popup: './src/popup/index.ts',
|
|
},
|
|
// devtool: 'inline-source-map',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'scripts/[name].bundle.js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js']
|
|
},
|
|
plugins: [
|
|
new CopyPlugin([
|
|
{ from: '**/*', to: '.', toType: "dir" },
|
|
], { context: 'template', logLevel: 'warn' }),
|
|
]
|
|
}; |