forked from Choices-js/Choices
-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.prod.js
47 lines (43 loc) · 998 Bytes
/
webpack.config.prod.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
const path = require('path');
const deepMerge = require('deepmerge');
const { BannerPlugin } = require('webpack');
const baseConfig = require('./webpack.config.base');
const { name, version, author, homepage } = require('./package.json');
const arrayMerge = (target, source) => [...source, ...target];
const prodConfig = deepMerge(
baseConfig,
{
mode: 'production',
output: {
path: path.join(__dirname, '/public/assets/scripts'),
publicPath: '/public/assets/scripts/',
},
plugins: [
new BannerPlugin(
`${name} v${version} | © ${new Date().getFullYear()} ${author} | ${homepage}`,
),
],
},
{
arrayMerge,
},
);
module.exports = [
deepMerge(
prodConfig,
{
output: { filename: 'choices.js', libraryTarget: 'umd' },
optimization: { minimize: false },
},
{
arrayMerge,
},
),
deepMerge(
prodConfig,
{ output: { filename: 'choices.min.js' } },
{
arrayMerge,
},
),
];