PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
visualizer / classes / Visualizer / D3Renderer / webpack.config.js

webpack.config.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 4.0.8, at classes/Visualizer/D3Renderer/webpack.config.js

44 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const path = require( 'path' );
2 const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
3
4 const buildDir = path.resolve( __dirname, 'build' );
5
6 /**
7 * Main bundle (index.js) — standard wp-scripts config with WP dependency
8 * extraction. Runs in the parent page context.
9 */
10 const mainConfig = {
11 ...defaultConfig,
12 entry: {
13 index: path.resolve( __dirname, 'src/index.js' ),
14 },
15 output: {
16 ...defaultConfig.output,
17 path: buildDir,
18 },
19 };
20
21 /**
22 * Iframe bundle (iframe.js) — standalone IIFE that runs inside a sandboxed
23 * iframe. WordPress dependency extraction is disabled so that d3 and
24 * topojson are bundled inline (the iframe has no access to wp.* globals).
25 */
26 const iframeConfig = {
27 ...defaultConfig,
28 entry: {
29 iframe: path.resolve( __dirname, 'src/iframe.js' ),
30 },
31 output: {
32 ...defaultConfig.output,
33 path: buildDir,
34 },
35 // Remove DependencyExtractionWebpackPlugin — iframe has no WP globals.
36 plugins: defaultConfig.plugins.filter(
37 ( plugin ) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
38 ),
39 // Bundle d3/topojson inline; do not treat anything as external.
40 externals: {},
41 };
42
43 module.exports = [ mainConfig, iframeConfig ];
44