-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.config.js
74 lines (69 loc) · 1.59 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
73
74
const path = require('path');
const webpack = require('webpack');
const GenerateJsonPlugin = require('generate-json-webpack-plugin');
const manifest = require('./src/manifest.json');
const package = require('./package.json');
manifest.version = package.version;
const commonModule = {
loaders: [
{
test: /\.(png|jpg|gif|html|css)$/,
loader: 'file-loader?name=[name].[ext]'
}
],
};
const Extension = {
name: "Extension",
entry: {
Content: './lib/es6/src/extension/content.js',
ContentLoader: './lib/es6/src/extension/contentLoader.js',
Popup: './lib/es6/src/extension/popup.js',
Background: './lib/es6/src/extension/background.js',
},
output: {
path: path.join(__dirname, '_build/extension/'),
filename: '[name].bundle.js',
},
module: commonModule,
plugins: [
new GenerateJsonPlugin('manifest.json', manifest),
new webpack.DefinePlugin({
'__REASON_VERSION__': '"3.0.0"',
'__OCAML_VERSION__': '"4.02.3"'
}),
],
node: {
fs: "empty"
},
resolve: {
alias: {
react: path.resolve('./node_modules/react'),
},
},
};
const Page = {
name: "Page",
entry: {
Popup: './lib/es6/src/extension/page.js',
},
output: {
path: path.join(__dirname, 'docs/'),
filename: '[name].bundle.js',
},
plugins: [
new webpack.DefinePlugin({
'__REASON_VERSION__': '"3.0.0"',
'__OCAML_VERSION__': '"4.02.3"'
}),
],
module: commonModule,
node: {
fs: "empty"
},
resolve: {
alias: {
react: path.resolve('./node_modules/react'),
},
},
};
module.exports = [Extension, Page];