* @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 = {})
| 10 | * @see https://github.com/webpack-contrib/css-loader |
| 11 | */ |
| 12 | function 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. |
no outgoing calls
no test coverage detected