forked from hermit-crab/ScrapeMate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (50 loc) · 1.44 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
const path = require('path')
const { DefinePlugin } = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { preprocess } = require('preprocess')
const meta = require('./package.json');
function fillManifest (content, path) {
return preprocess(content.toString(), {env: process.env, meta: meta}, {type: 'js'})
}
module.exports = {
mode: 'none',
entry: {
background: './src/background.js',
content: './src/content.js',
sidebar: './src/sidebar.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist/extension')
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
plugins: [
CopyWebpackPlugin([
'src/content.css',
'src/sidebar.html',
'src/sidebar.css',
{from: 'icons', to: 'icons'},
{from: 'vendor/selectorgadget_combined.*', to: 'vendor', flatten: true},
{from: 'vendor/fontawesome', to: 'vendor/fontawesome'},
{from: 'vendor/reset.css', to: 'vendor'},
{from: 'manifest.json', to: 'manifest.json', transform: fillManifest},
]),
new DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
})
]
}