-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
31 lines (29 loc) · 1.01 KB
/
webpack.dev.js
File metadata and controls
31 lines (29 loc) · 1.01 KB
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
import { merge } from 'webpack-merge';
import { execSync } from 'child_process';
import common, { packageJson } from './webpack.common.js';
let gitCommitHash = '';
try {
gitCommitHash = execSync('git rev-parse --short HEAD').toString().trim();
} catch (e) {
console.warn('Could not get git commit hash: ', e);
}
export default (env) => {
const appVersion = gitCommitHash ? `${packageJson.version}-${gitCommitHash}` : packageJson.version;
return merge(common(env, { appVersion }), {
mode: 'development',
devtool: 'eval-source-map',
devServer: {
static: './dist',
client: {
overlay: false,
},
hot: true,
historyApiFallback: true,
headers: {
"Access-Control-Allow-Origin": "https://intel.ingress.com",
"Access-Control-Allow-Methods": "GET",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
}
},
});
};