-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (57 loc) · 1.47 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ZipPlugin = require('zip-webpack-plugin');
const DotEnv = require('dotenv-webpack');
const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant');
module.exports = {
entry: {
content_script: './src/content_script.js',
background: './src/background/background.js',
options: './src/options/options.js',
},
output: {
filename: '[name].bundle.js',
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader' },
{ test: /\.vue$/, use: 'vue-loader' },
{ test: /\.css$/, use: ['vue-style-loader', 'css-loader'] },
{ test: /\.scss$/, use: ['vue-style-loader', 'css-loader', 'sass-loader'] },
],
},
plugins: [
new VueLoaderPlugin(),
new DotEnv(),
new CopyWebpackPlugin([
{
from: 'manifest.json',
},
{
from: '**/*.html',
context: 'src',
},
{
from: '**/*',
to: 'icons/',
context: 'icons',
transform: (content) => imagemin.buffer(content, {
plugins: [imageminPngquant()],
}),
},
{
from: '**/*',
to: 'images/',
context: 'images',
transform: (content) => imagemin.buffer(content, {
plugins: [imageminPngquant()],
}),
},
]),
new ZipPlugin({
path: 'zip',
filename: 'threads-for-youtube',
}),
],
};