forked from b3008/executable_HTML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (37 loc) · 1.08 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
const path = require('path');
var webpack = require("webpack");
var childProcess = require('child_process');
var buildBranch = childProcess.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
let build = require("./dist/build.json");
build.build++;
build.version = require("./package.json").version;
module.exports = {
entry: {
'aaCustomElements': './src/index.js',
'paper-polymer': './paper-polymer-imports.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
chunkFilename: '[name].js',
// publicPath: 'dist/',
// jsonpScriptType:"module",
libraryTarget: "umd",
library:"executableHTML"
},
mode: "development",
devtool:"source-map",
plugins: [
new webpack.DefinePlugin({
VERSION: build.version,
BUILD_NUMBER: build.build,
BUILD_BRANCH: buildBranch,
BUILD_STRING: buildBranch+":"+build.build
})
]
};
const fs = require('fs');
build.date = new Date().toString();
build.branch = buildBranch;
let data = JSON.stringify(build, null, 2);
fs.writeFileSync('./dist/build.json', data);