-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathwebpack.config.js
72 lines (71 loc) · 2.22 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
mode: 'development',
entry: {
'chrome/content/main': './src/index.js',
'chrome/content/preferences': './src/dialogs/preferences/index.js',
'chrome/content/editor': './src/dialogs/editor/index.js',
'chrome/content/citation-importer': './src/dialogs/citation-importer/index.js',
'chrome/content/identifier-importer': './src/dialogs/identifier-importer/index.js'
},
output: {
filename: '[name].js',
path: __dirname + '/dist'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
resolve: {
extensions: ['*', '.js', '.jsx'],
fallback: {
'querystring': require.resolve("querystring-es3"),
'http': false, //require.resolve('stream-http'),
'https': false //require.resolve('https-browserify'),
// 'url': require.resolve('url/'),
// 'buffer': require.resolve('buffer/')
}
},
optimization: {
minimize: false
},
devtool: 'inline-source-map',
externals: {
'zotero@components/button': 'commonjs components/button',
'zotero@components/editable': 'commonjs components/editable',
'zotero@components/form/input': 'commonjs components/form/input',
'zotero@zotero/filePicker': 'commonjs zotero/filePicker',
'zotero@zotero/modules/filePicker': 'commonjs zotero/modules/filePicker', // support Zotero af597d9
'zotero@zotero/itemTree': 'commonjs zotero/itemTree'
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "static", to: "." },
{ from: "LICENSE.md", to: "." },
{
from: "static/chrome/locale",
to: "./chrome/content/locale"
},
{ from: "translators/*.js", to: "./chrome/content/translators/[name].[ext]" },
{
from: "translators/zotkat/Wikidata QuickStatements.js",
to: "./chrome/content/translators"
},
{
from: "Local-Citation-Network/index*",
to: "./chrome/content/Local-Citation-Network/[name].[ext]"
},
{
from: "Local-Citation-Network/lib",
to: "./chrome/content/Local-Citation-Network/lib"
}
]
})
]
};