2021-12-09 19:46:19 +01:00
|
|
|
/* eslint-disable no-undef */
|
|
|
|
const path = require('path')
|
2021-11-09 22:10:35 +01:00
|
|
|
|
2021-12-09 19:46:19 +01:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin')
|
2021-11-09 22:10:35 +01:00
|
|
|
|
2021-12-09 19:46:19 +01:00
|
|
|
const FOLDER_SOURCE = './source'
|
2021-11-09 22:10:35 +01:00
|
|
|
|
|
|
|
module.exports = {
|
2021-12-14 15:33:07 +01:00
|
|
|
entry: {
|
2021-12-14 17:54:47 +01:00
|
|
|
'block-events-loader': FOLDER_SOURCE + '/front/block-events-loader.js',
|
2021-12-14 15:33:07 +01:00
|
|
|
},
|
2021-11-09 22:10:35 +01:00
|
|
|
output: {
|
2021-12-14 15:33:07 +01:00
|
|
|
filename: '[name].js',
|
2021-12-14 17:54:47 +01:00
|
|
|
path: path.resolve(__dirname, 'build/front'),
|
2021-11-09 22:10:35 +01:00
|
|
|
},
|
2022-01-09 12:35:26 +01:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.m?js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [['@babel/preset-env', { targets: 'defaults' }]],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-11-09 22:10:35 +01:00
|
|
|
plugins: [
|
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{
|
2021-12-14 17:51:13 +01:00
|
|
|
context: FOLDER_SOURCE,
|
2021-11-09 22:10:35 +01:00
|
|
|
from: '**/*.php',
|
|
|
|
to: '../',
|
|
|
|
},
|
|
|
|
{
|
2021-12-14 17:51:13 +01:00
|
|
|
context: FOLDER_SOURCE,
|
2021-11-09 22:10:35 +01:00
|
|
|
from: '**/*.txt',
|
|
|
|
to: '../',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
2021-12-09 19:46:19 +01:00
|
|
|
}
|