-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
38 lines (35 loc) · 1.08 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
var path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const plugins = [
new CopyWebpackPlugin({
patterns: [
{ from: 'node_modules/sweetalert2/dist/sweetalert2.min.css', to: 'sweetalert2.min.css' },
{ from: 'node_modules/sweetalert2/dist/sweetalert2.js', to: 'sweetalert2.js' },
{ from: 'node_modules/promise-polyfill/dist/polyfill.min.js', to: 'polyfill.min.js' },
{ from: 'node_modules/clipboard/dist/clipboard.min.js', to: 'clipboard.min.js' },
]
})
];
module.exports = [
{
output: {
filename: 'fapi.dist.js',
path: path.resolve(__dirname, 'media/dist'),
},
entry: './media/fapi.js',
mode: 'production',
target: 'browserslist',
plugins: plugins,
watch: true
},
{
output: {
filename: 'fapi.dev.js',
path: path.resolve(__dirname, 'media/dist'),
},
entry: './media/fapi.js',
mode: 'development',
plugins: plugins,
watch: true
},
];