Download next.js/packages/next/src/bundles/cssnano-simple/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.84 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/bundles/cssnano-simple/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/bundles/cssnano-simple/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/bundles/cssnano-simple/index.js
1.84 kB
| // Originated from https://github.com/Timer/cssnano-simple/blob/master/src/index.js | |
| /** | |
| * This file is the actual "cssnano-simple" implementation, which will eventually be used | |
| * by "next/src/build/cssnano-simple" | |
| */ | |
| const createSimplePreset = require('./cssnano-preset-simple') | |
| module.exports = (opts = {}, postcss = require('postcss')) => { | |
| const excludeAll = Boolean(opts && opts.excludeAll) | |
| const userOpts = Object.assign({}, opts) | |
| if (excludeAll) { | |
| for (const userOption in userOpts) { | |
| if (!userOpts.hasOwnProperty(userOption)) continue | |
| const val = userOpts[userOption] | |
| if (!Boolean(val)) { | |
| continue | |
| } | |
| if (Object.prototype.toString.call(val) === '[object Object]') { | |
| userOpts[userOption] = Object.assign({}, { exclude: false }, val) | |
| } | |
| } | |
| } | |
| const options = Object.assign( | |
| {}, | |
| excludeAll ? { rawCache: true } : undefined, | |
| userOpts | |
| ) | |
| const plugins = [] | |
| createSimplePreset(options).plugins.forEach((plugin) => { | |
| if (Array.isArray(plugin)) { | |
| let [processor, pluginOpts] = plugin | |
| processor = processor.default || processor | |
| const isEnabled = | |
| // No options: | |
| (!excludeAll && typeof pluginOpts === 'undefined') || | |
| // Short-hand enabled: | |
| (typeof pluginOpts === 'boolean' && pluginOpts) || | |
| // Include all plugins: | |
| (!excludeAll && | |
| pluginOpts && | |
| typeof pluginOpts === 'object' && | |
| !pluginOpts.exclude) || | |
| // Exclude all plugins: | |
| (excludeAll && | |
| pluginOpts && | |
| typeof pluginOpts === 'object' && | |
| pluginOpts.exclude === false) | |
| if (isEnabled) { | |
| plugins.push(processor(pluginOpts)) | |
| } | |
| } else { | |
| plugins.push(plugin) | |
| } | |
| }) | |
| return postcss(plugins) | |
| } | |
| module.exports.postcss = true | |