forked from blockchain/My-Wallet-V3-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (57 loc) · 1.46 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
var DIST = Boolean(process.env.DIST);
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var outputRoot = DIST ? `${__dirname}/helperApp/dist` : `${__dirname}/helperApp/build`;
module.exports = {
entry: {
'plaid/plaid': `${__dirname}/helperApp/plaid/index.js`,
'sift-science/sift-science': `${__dirname}/helperApp/sift-science/index.js`
},
output: {
path: outputRoot,
filename: DIST ? '[name]-[hash].js' : '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: [/node_modules/],
use: [{
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}]
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
}
],
fallback: 'style-loader'
})
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: `${__dirname}/helperApp/plaid/index.html`,
filename: 'plaid/index.html',
chunks: ['plaid/plaid']
}),
new HtmlWebpackPlugin({
template: `${__dirname}/helperApp/sift-science/index.html`,
filename: 'sift-science/index.html',
chunks: ['sift-science/sift-science']
}),
new ExtractTextPlugin(
DIST ? '[name]-[hash].css' : '[name].css'
)
]
};