forked from JetBrains/toolbox-browser-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
51 lines (48 loc) · 1.3 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
/* eslint-env node */
/* eslint-disable import/no-commonjs */
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const LicenseChecker = require('@jetbrains/ring-ui-license-checker');
module.exports = {
entry: {
github: './github',
common: ['./common'] // https://github.com/webpack/webpack/issues/300
},
output: {
filename: 'jetbrains-toolbox-[name].js',
path: path.resolve(__dirname, 'dist')
},
module: {
loaders: [
{
test: require.resolve('whatwg-fetch'),
loader: 'imports?Promise=core-js/es6/promise'
},
{
test: /\.js$/,
loader: 'babel'
},
{
test: /\.(svg|png)$/,
loader: 'file?name=[name].[ext]'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'common',
minChunks: 2
}),
new CopyWebpackPlugin([
{from: 'manifest.json'},
{from: 'icon-128.png'} // Replace with logo from package after it's generation
]),
new LicenseChecker({
format: params => params.modules.map(mod => `${mod.name}@${mod.version} (${mod.url})
${mod.license.name} (${mod.license.url})`).join('\n\n'),
filename: 'third-party-licences.txt',
exclude: /@jetbrains\/logos/
})
]
};