MCPcopy Index your code
hub / github.com/andywer/webpack-blocks / css

Function css

packages/assets/lib/css.js:12–30  ·  view source on GitHub ↗

* @param {object} [options] You can pass all css-loader options. * @param {object} [options.styleLoader] style-loader options. If set to 'false' the 'style-loader' won't be added. * @return {Function} * @see https://github.com/webpack-contrib/css-loader

(options = {})

Source from the content-addressed store, hash-verified

10 * @see https://github.com/webpack-contrib/css-loader
11 */
12function css(options = {}) {
13 const cssOptions = _.omit(options, ['styleLoader'])
14 const loaders = [{ loader: 'css-loader', options: cssOptions }]
15
16 if (options.styleLoader !== false) {
17 loaders.unshift({ loader: 'style-loader', options: options.styleLoader || {} })
18 }
19
20 return (context, util) =>
21 util.addLoader(
22 Object.assign(
23 {
24 test: /\.css$/,
25 use: loaders
26 },
27 context.match
28 )
29 )
30}
31
32/**
33 * @param {object} [options] You can pass all css-loader options.

Callers 6

css.test.jsFile · 0.50
webpack.config.jsFile · 0.50
webpack.config.jsFile · 0.50
webpack.config.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected