-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
38 lines (37 loc) · 1.14 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
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ZipPlugin = require('zip-webpack-plugin')
module.exports = {
mode: 'production', // "production" | "development" | "none"
entry: './src/script.js',
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, 'dist/src'), // string (default)
// the target directory for all output files
// must be an absolute path (use the Node.js path module)
filename: 'script.js', // string (default)
// the filename template for entry chunks
// publicPath: '/assets/', // string
// the url to the output directory resolved relative to the HTML page
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/(node_modules)/, /(dev)/]
}
]
},
plugins: [
// Copy manifest.json to dist folder
new CopyWebpackPlugin({
patterns: [path.resolve(__dirname, './src/manifest.json')],
}),
// Zip the output
new ZipPlugin({
path: path.resolve(__dirname, 'dist/zip'),
filename: 'google-shortcuts-extension.zip',
})
],
}