mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 04:22:21 +08:00
* fix: switch was not working properly in some cases * update: revert wp-scripts version to 28.0.0 to add support for older WordPress versions * update: revert wp-scripts to 27.9.0 * add: support for react-jsx-runtime in older versions of WordPress * update: version to the latest wp-scripts 30.3.0 * update: add lib/ to gitignore * update: plugin name
68 lines
1.4 KiB
JavaScript
68 lines
1.4 KiB
JavaScript
const path = require('path');
|
|
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
|
|
|
|
// add your entry points here
|
|
const entryPoints = {
|
|
admin: path.resolve(process.cwd(), 'modules/settings/assets/js', 'admin.js'),
|
|
};
|
|
|
|
// React JSX Runtime Polyfill
|
|
const reactJSXRuntimePolyfill = {
|
|
entry: {
|
|
'react-jsx-runtime': {
|
|
import: 'react/jsx-runtime',
|
|
},
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'assets/lib'),
|
|
filename: 'react-jsx-runtime.js',
|
|
library: {
|
|
name: 'ReactJSXRuntime',
|
|
type: 'window',
|
|
},
|
|
},
|
|
externals: {
|
|
react: 'React',
|
|
},
|
|
};
|
|
|
|
module.exports = [
|
|
{
|
|
...defaultConfig,
|
|
entry: entryPoints,
|
|
output: {
|
|
...defaultConfig.output,
|
|
path: path.resolve(process.cwd(), 'assets/build'),
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@ea11y/hooks': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/hooks/',
|
|
),
|
|
'@ea11y/components': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/components/',
|
|
),
|
|
'@ea11y/icons': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/icons/',
|
|
),
|
|
'@ea11y/layouts': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/layouts/',
|
|
),
|
|
'@ea11y/pages': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/pages/',
|
|
),
|
|
'@ea11y/services': path.resolve(
|
|
__dirname,
|
|
'modules/settings/assets/js/services',
|
|
),
|
|
},
|
|
extensions: ['.js', '.jsx'],
|
|
},
|
|
},
|
|
reactJSXRuntimePolyfill,
|
|
];
|