| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/public_html/wp-content/plugins/really-simple-ssl/settings/ |
Upload File : |
const path = require('path');
const defaultConfig = require("@wordpress/scripts/config/webpack.config");
const featureFolders = ['two-fa']; // Add more folders as needed
const isProduction = process.env.NODE_ENV === 'production';
const { ProvidePlugin, Compilation } = require('webpack');
const fs = require('fs');
module.exports = {
...defaultConfig,
entry: featureFolders.reduce((entries, folder) => {
const jsPath = path.resolve(__dirname, `../security/wordpress/${folder}/assets/js/index.js`);
const scssPath = path.resolve(__dirname, `../security/wordpress/${folder}/assets/css/${folder}.scss`);
// check if the file exists
if (fs.existsSync(jsPath)) {
entries[`${folder}/assets`] = jsPath;
} else {
console.error(`File ${jsPath} does not exist`);
}
if (fs.existsSync(scssPath)) {
entries[`${folder}/styles`] = scssPath;
} else {
console.error(`File ${scssPath} does not exist`);
}
return entries;
}, {}),
output: {
path: path.resolve(__dirname, `../assets/features/`), // Output to the features directory
filename: '[name].min.js',
clean: false,
},
resolve: {
...defaultConfig.resolve,
modules: [
path.resolve(__dirname, '../settings/node_modules'), // Look in settings' node_modules
path.resolve(__dirname, '../node_modules'), // Look in the root node_modules
'node_modules', // Fallback to default node_modules
],
fallback: {
"path": require.resolve("path-browserify"),
"stream": require.resolve("stream-browserify"),
"buffer": require.resolve("buffer/"),
},
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules,
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
plugins: [
...defaultConfig.plugins,
new ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser',
}),
],
optimization: {
...defaultConfig.optimization,
minimize: isProduction,
},
stats: {
errors: true,
moduleTrace: true,
errorDetails: true,
},
};