How to use @wordpress/dependency-extraction-webpack-plugin - 6 common examples

To help you get started, we’ve selected a few @wordpress/dependency-extraction-webpack-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ampproject / amp-wp / webpack.config.js View on Github external
requestToExternal: ( request ) => {
				switch ( request ) {
					case '@wordpress/dom-ready':
					case '@wordpress/i18n':
					case '@wordpress/polyfill':
					case '@wordpress/url':
						return undefined;

					default:
						return defaultRequestToExternal( request );
				}
			},
		} ),
github getblocklab / block-lab / webpack.config.js View on Github external
requestToExternal: ( request ) => {
				switch ( request ) {
					case '@wordpress/dom-ready':
					case '@wordpress/i18n':
					case '@wordpress/server-side-render':
					case '@wordpress/url':
						return undefined;

					default:
						return defaultRequestToExternal( request );
				}
			},
		} ),
github getblocklab / block-lab / webpack.config.js View on Github external
requestToHandle: ( request ) => {
				switch ( request ) {
					case '@wordpress/dom-ready':
					case '@wordpress/i18n':
					case '@wordpress/server-side-render':
					case '@wordpress/url':
						return undefined;

					default:
						return defaultRequestToHandle( request );
				}
			},
			requestToExternal: ( request ) => {
github ampproject / amp-wp / webpack.config.js View on Github external
requestToHandle: ( request ) => {
				switch ( request ) {
					case '@wordpress/dom-ready':
					case '@wordpress/i18n':
					case '@wordpress/polyfill':
					case '@wordpress/url':
						return undefined;

					default:
						return defaultRequestToHandle( request );
				}
			},
			requestToExternal: ( request ) => {
github intraxia / wp-gistpen / .beaverrc.js View on Github external
config.plugins.push(
      new StyleLintPlugin({
        syntax: 'scss',
        context: path.join(__dirname, dir),
      }),
    );
    config.plugins.push(
      new WebpackNotifierPlugin({
        alwaysNotify: true,
        emoji: true,
      }),
    );
    config.plugins.push(new PrismLanguageGenerationPlugin());
    config.plugins.push(
      new DependencyExtractionWebpackPlugin({
        outputFormat: 'json',
        combineAssets: true,
        combinedOutputFile: `wp-assets${isProd(state) ? '.min' : ''}.json`,
      }),
    );

    if (isProd(state)) {
      config.plugins[0].opts.fileName = 'asset-manifest.min.json';
      config.plugins.push(
        new CopyWebpackPlugin([
          {
            from: 'node_modules/prismjs/components/*.js',
            flatten: true,
          },
        ]),
      );
github LearnPress / learnpress / tools / build.packages.js View on Github external
entry: buildPackages.reduce( ( memo, slug ) => {
			const basename = path.basename( slug );
			const name = camelCaseDash( basename );
			memo[name] = path.resolve( packageDir, `js/${slug}.js` );
			return memo;
		}, {} ),
		output: {

@wordpress/dependency-extraction-webpack-plugin

Extract WordPress script dependencies from webpack bundles.

GPL-2.0-or-later
Latest version published 11 days ago

Package Health Score

95 / 100
Full package analysis