-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
52 lines (50 loc) · 1.41 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
var WebpackNotifierPlugin = require('webpack-notifier');
var webpack = require('webpack');
const path = require("path");
// get git info from command line
let commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString();
module.exports = {
entry: {
background: "./src/background.js",
"vr-browser": "./src/vr-browser/index.jsx",
content: "./src/content.js",
},
output: {
path: path.resolve(__dirname, "addon/build"),
filename: "[name]/index.js"
},
devtool: "source-map",
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['env', 'react'],
plugins: [require('babel-plugin-transform-object-rest-spread')]
}
},
{
test: /.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['env'],
plugins: [require('babel-plugin-transform-object-rest-spread')]
}
}
]
},
plugins: [
new WebpackNotifierPlugin({
contentImage: path.join(__dirname, 'addon/icons/vr-48.png'),
alwaysNotify: true
}),
new webpack.DefinePlugin({
__GIT_REVISION__: JSON.stringify(commitHash),
})
],
};