-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
35 lines (34 loc) · 983 Bytes
/
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
const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
entry: {
backtotop: { import: './public/js/backtotop.js', filename: './js/backtotop.js' },
menus: { import: './public/js/menus.js', filename: './js/menus.js' },
vendor: { import: './public/js/vendor.js', filename: './js/vendor.js' },
},
mode: 'production',
output: {
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
// {
// test: /\.(woff|woff2|eot|ttf|otf)$/i,
// type: 'asset/resource',
// generator: {
// filename: 'fonts/[name].[ext][query]',
// },
// },
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'public/img', to: './img' },
{ from: 'public/fonts', to: './fonts' },
{ from: 'public/css', to: './css' },
{ from: './node_modules/bootstrap/dist/js/bootstrap.min.js', to: './js/bootstrap.min.js' },
],
}),
],
}