-
Notifications
You must be signed in to change notification settings - Fork 28
/
webpack.config.js
41 lines (35 loc) · 952 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
36
37
38
39
40
41
/**
* `@wordpress/scripts` path-based name multi-block Webpack configuration.
* @see https://wordpress.stackexchange.com/questions/390282
*/
// Native Depedencies.
const path = require('path');
// Third-Party Dependencies.
const CopyPlugin = require('copy-webpack-plugin');
const config = require('@wordpress/scripts/config/webpack.config.js');
config.entry = {
'pmpro_affiliates_report/index': path.resolve(
process.cwd(),
'blocks',
'src',
'pmpro_affiliates_report',
'index.js'
)
};
config.output = {
filename: '[name].js',
path: path.resolve(process.cwd(), 'blocks', 'build'),
};
// Add a CopyPlugin to copy over block.json files.
config.plugins.push(
new CopyPlugin({
patterns: [
{
context: 'blocks/src',
from: `*/block.json`,
noErrorOnMissing: true,
},
],
})
);
module.exports = config;