mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
40 lines
929 B
JavaScript
40 lines
929 B
JavaScript
|
|
const path = require('path')
|
||
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
mode: 'production',
|
||
|
|
entry: {
|
||
|
|
background: './src/background.ts',
|
||
|
|
toolbar: './src/scripts/content/toolbar.ts',
|
||
|
|
content: './src/scripts/content/content.ts',
|
||
|
|
},
|
||
|
|
module: {
|
||
|
|
rules: [
|
||
|
|
{
|
||
|
|
test: /\.ts$/,
|
||
|
|
use: 'ts-loader',
|
||
|
|
exclude: /node_modules/,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
resolve: {
|
||
|
|
extensions: ['.ts', '.js'],
|
||
|
|
},
|
||
|
|
output: {
|
||
|
|
filename: '[name].js',
|
||
|
|
path: path.resolve(__dirname, 'extension'),
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
new CleanWebpackPlugin(),
|
||
|
|
new CopyWebpackPlugin({
|
||
|
|
patterns: [
|
||
|
|
{ from: 'src/manifest.json', to: 'manifest.json' },
|
||
|
|
{ from: 'src/icons', to: 'icons' },
|
||
|
|
{ from: 'src/images', to: 'images' },
|
||
|
|
{ from: 'src/views', to: 'views' },
|
||
|
|
],
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
}
|