Download wp-calypso/apps/command-palette-wp-admin/webpack.config.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/command-palette-wp-admin/webpack.config.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/command-palette-wp-admin/webpack.config.js
-
curl -L -o webpack.config.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/command-palette-wp-admin/webpack.config.js
1.56 kB
| /** | |
| *WARNING: No ES6 modules here. Not transpiled! **** | |
| */ | |
| const path = require( 'path' ); | |
| const getBaseWebpackConfig = require( '@automattic/calypso-build/webpack.config.js' ); | |
| const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); | |
| const webpack = require( 'webpack' ); | |
| const GenerateChunksMapPlugin = require( '../../build-tools/webpack/generate-chunks-map-plugin' ); | |
| function getWebpackConfig( env, argv ) { | |
| const webpackConfig = getBaseWebpackConfig( { ...env, WP: true }, argv ); | |
| return { | |
| ...webpackConfig, | |
| entry: { | |
| build: path.join( __dirname, 'src', 'index' ), | |
| }, | |
| output: { | |
| ...webpackConfig.output, | |
| filename: '[name].min.js', | |
| }, | |
| plugins: [ | |
| ...webpackConfig.plugins.filter( | |
| ( plugin ) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin' | |
| ), | |
| new GenerateChunksMapPlugin( { | |
| output: path.resolve( __dirname, 'dist/chunks-map.json' ), | |
| } ), | |
| new webpack.DefinePlugin( { | |
| __i18n_text_domain__: JSON.stringify( 'command-palette' ), | |
| } ), | |
| new DependencyExtractionWebpackPlugin( { | |
| injectPolyfill: true, | |
| outputFilename: '[name].asset.php', | |
| requestToExternal( request ) { | |
| // The extraction logic will only extract a dependency if requestToExternal | |
| // explicitly returns undefined for the given request. Null shortcuts the | |
| // logic such that @wordpress/react-i18n styles are bundled. | |
| if ( request === '@wordpress/react-i18n' ) { | |
| return null; | |
| } | |
| }, | |
| } ), | |
| ], | |
| }; | |
| } | |
| module.exports = getWebpackConfig; | |