Use webpack to replace modified version lock lock-unlock
This commit is contained in:
parent
448a7e1fea
commit
c9ad56bb64
|
@ -1,7 +0,0 @@
|
|||
const { execSync } = require("child_process");
|
||||
|
||||
// Find edit-site module directory
|
||||
const EDIT_SITE_DIR = execSync("find ../../node_modules/.pnpm -type d -name '@wordpress+edit-site@5.15.0*' -print -quit").toString().trim();
|
||||
|
||||
// Replace it with modified version
|
||||
execSync(`cp -rf "./bin/modified-editsite-lock-unlock.js" ${EDIT_SITE_DIR}/node_modules/@wordpress/edit-site/build-module/lock-unlock.js`);
|
|
@ -168,6 +168,19 @@ const webpackConfig = {
|
|||
},
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin( {
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(
|
||||
__dirname,
|
||||
'bin/modified-editsite-lock-unlock.js'
|
||||
), // Replace with the path to your custom script
|
||||
to: require.resolve(
|
||||
'@wordpress/edit-site/build-module/lock-unlock.js'
|
||||
), // Replace with the destination path
|
||||
},
|
||||
],
|
||||
} ),
|
||||
...styleConfig.plugins,
|
||||
// Runs TypeScript type checker on a separate process.
|
||||
! process.env.STORYBOOK && new ForkTsCheckerWebpackPlugin(),
|
||||
|
|
Loading…
Reference in New Issue