Download wp-calypso/packages/calypso-build/webpack/file-loader.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 755 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-build/webpack/file-loader.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-build/webpack/file-loader.js
-
curl -L -o file-loader.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-build/webpack/file-loader.js
755 Bytes
| const path = require( 'path' ); | |
| /** | |
| * Return a Webpack loader configuration object for files / images. | |
| * @param {Object} options Rule.generator options | |
| * @param options.outputPath Where to output the asset | |
| * @param options.name Name of the asset | |
| * @param options.publicPath Path used to generate the URL for the asset | |
| * @param options.emitFile Whether to write the assets to the filesystem (defaults to true) | |
| * @returns {Object} Webpack loader object | |
| */ | |
| module.exports.loader = ( { | |
| outputPath = 'images/', | |
| name = '[name]-[hash][ext]', | |
| publicPath, | |
| emitFile = true, | |
| } = {} ) => ( { | |
| test: /\.(?:gif|jpg|jpeg|png|svg)$/i, | |
| type: 'asset/resource', | |
| generator: { | |
| filename: path.join( outputPath, name ), | |
| publicPath, | |
| emit: emitFile, | |
| }, | |
| } ); | |