-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathwebpack.config.connector.js
37 lines (28 loc) · 1.05 KB
/
webpack.config.connector.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
const filter = require('lodash/filter')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin')
if (process.env.CIRCLE_BRANCH === 'master') process.env.ENV = 'PROD'
if (process.env.CIRCLE_BRANCH === 'dev') process.env.ENV = 'DEV'
if (process.env.CIRCLE_BRANCH === 'qa') process.env.ENV = 'QA'
require('coffee-script/register')
const baseConfig = require('appirio-tech-webpack-config')({
dirname: __dirname
})
const plugins = baseConfig.plugins.filter( (plugin) => !(plugin instanceof HtmlWebpackPlugin) && !(plugin instanceof CompressionPlugin) )
plugins.push(new HtmlWebpackPlugin({
inject: false,
template: path.join(__dirname, '/connector/index.jade'),
filename: 'connector.html'
}))
const config = Object.assign(baseConfig, {
entry: path.join(__dirname, '/connector/connector-embed.js'),
output: {
path: path.join(__dirname, 'dist/'),
publicPath: '',
filename: 'connector.js'
},
plugins
})
console.log(config.plugins)
module.exports = config