source/client configuration.js
function generate_extract_css_loaders(after_style_loader, development, extract_css_plugin, useMiniCssExtractPlugin)
{
	let extract_css_loaders

	if (useMiniCssExtractPlugin)
	{
		const MiniCssExtractPlugin = require('mini-css-extract-plugin')

		return [{
			loader: MiniCssExtractPlugin.loader
		},
		...after_style_loader]
	}

	// The first argument to the .extract() function is the name of the loader
	// ("style-loader" in this case) to be applied to non-top-level-chunks in case of "allChunks: false" option.
	// since in this configuration "allChunks: true" option is used, this first argument is irrelevant.
	//
	// `remove: false` ensures that the styles being extracted
	// aren't erased from the chunk javascript file.
	//
	const extract_css_loader = extract_css_plugin.extract
	({
		remove    : development ? false : true,
		// `fallback` option is not really being used
		// because `allChunks: true` option is used.
		// fallback  : before_style_loader,
		use       : after_style_loader
	})

	// Workaround for an old bug, may be obsolete now.
	// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/368
	if (Array.isArray(extract_css_loader))
	{
		extract_css_loaders = extract_css_loader
	}
	else
	{
		extract_css_loaders =
		[{
			loader: extract_css_loader
		}]
	}

	// I'm also prepending another `style-loader` here
	// to re-enable adding these styles to the <head/> of the page on-the-fly.
	if (development)
	{
		return [{
			loader: 'style-loader'
		},
		...extract_css_loaders]
	}

	return extract_css_loaders
}
function generate_extract_css_loaders(after_style_loader, development, extract_css_plugin, useMiniCssExtractPlugin)
{
	let extract_css_loaders

	if (useMiniCssExtractPlugin)
	{
		const MiniCssExtractPlugin = require('mini-css-extract-plugin')

		return [{
			loader: MiniCssExtractPlugin.loader
		},
		...after_style_loader]
	}

	// The first argument to the .extract() function is the name of the loader
	// ("style-loader" in this case) to be applied to non-top-level-chunks in case of "allChunks: false" option.
	// since in this configuration "allChunks: true" option is used, this first argument is irrelevant.
	//
	// `remove: false` ensures that the styles being extracted
	// aren't erased from the chunk javascript file.
	//
	const extract_css_loader = extract_css_plugin.extract
	({
		remove    : development ? false : true,
		// `fallback` option is not really being used
		// because `allChunks: true` option is used.
		// fallback  : before_style_loader,
		use       : after_style_loader
	})

	// Workaround for an old bug, may be obsolete now.
	// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/368
	if (Array.isArray(extract_css_loader))
	{
		extract_css_loaders = extract_css_loader
	}
	else
	{
		extract_css_loaders =
		[{
			loader: extract_css_loader
		}]
	}

	// I'm also prepending another `style-loader` here
	// to re-enable adding these styles to the <head/> of the page on-the-fly.
	if (development)
	{
		return [{
			loader: 'style-loader'
		},
		...extract_css_loaders]
	}

	return extract_css_loaders
}
function generate_extract_css_loaders ( after_style_loader , development , extract_css_plugin , useMiniCssExtractPlugin ) { let extract_css_loaders if ( useMiniCssExtractPlugin ) { const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) return [ { loader : MiniCssExtractPlugin . loader } , ... after_style_loader ] } // The first argument to the .extract() function is the name of the loader // ("style-loader" in this case) to be applied to non-top-level-chunks in case of "allChunks: false" option. // since in this configuration "allChunks: true" option is used, this first argument is irrelevant. // // `remove: false` ensures that the styles being extracted // aren't erased from the chunk javascript file. // const extract_css_loader = extract_css_plugin . extract ( { remove : development ? false : true , // `fallback` option is not really being used // because `allChunks: true` option is used. // fallback  : before_style_loader, use : after_style_loader } ) // Workaround for an old bug, may be obsolete now. // https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/368 if ( Array . isArray ( extract_css_loader ) ) { extract_css_loaders = extract_css_loader } else { extract_css_loaders = [ { loader : extract_css_loader } ] } // I'm also prepending another `style-loader` here // to re-enable adding these styles to the <head/> of the page on-the-fly. if ( development ) { return [ { loader : 'style-loader' } , ... extract_css_loaders ] } return extract_css_loaders }
Generates rule.use loaders for extracting styles in a file.
Either for `extract-text-webpack-plugin` or `mini-css-extract-plugin`.
Generates rule . use loaders for extracting styles in a file . Either for extract - text - webpack - plugin or mini - css - extract - plugin .