-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
44 lines (40 loc) · 963 Bytes
/
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
const webpack = require("webpack");
const path = require("path");
const package = require("./package.json");
//Build meta banner
const pluginConfig = {
'name': package["pretty-name"],
'author': package.author,
'authorLink': package.authorLink,
'source': package.source,
'description': package.description,
'version': package.version,
};
const meta = (() => {
const lines = ["/**"];
for (const key in pluginConfig) {
lines.push(` * @${key} ${pluginConfig[key]}`);
}
lines.push(" */");
return lines.join("\n");
})();
//Webpack config
module.exports = {
mode: "development",
target: "node",
devtool: false,
entry: package.main,
output: {
filename: "LaTeX.plugin.js",
path: path.join(__dirname, "dist"),
libraryTarget: "commonjs2",
libraryExport: "default",
compareBeforeEmit: false
},
resolve: {
extensions: [".js"],
},
plugins: [
new webpack.BannerPlugin({raw: true, banner: meta}),
]
};