(content, map, meta)
| 31 | } from "./utils"; |
| 32 | |
| 33 | export default async function loader(content, map, meta) { |
| 34 | const rawOptions = this.getOptions(schema); |
| 35 | const callback = this.async(); |
| 36 | |
| 37 | if ( |
| 38 | this._compiler && |
| 39 | this._compiler.options && |
| 40 | this._compiler.options.experiments && |
| 41 | this._compiler.options.experiments.css && |
| 42 | this._module && |
| 43 | (this._module.type === "css" || |
| 44 | this._module.type === "css/auto" || |
| 45 | this._module.type === "css/global" || |
| 46 | this._module.type === "css/module") |
| 47 | ) { |
| 48 | this.emitWarning( |
| 49 | new Error( |
| 50 | 'You can\'t use `experiments.css` (`experiments.futureDefaults` enable built-in CSS support by default) and `css-loader` together, please set `experiments.css` to `false` or set `{ type: "javascript/auto" }` for rules with `css-loader` in your webpack config (now css-loader does nothing).', |
| 51 | ), |
| 52 | ); |
| 53 | |
| 54 | callback(null, content, map, meta); |
| 55 | |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | let options; |
| 60 | |
| 61 | try { |
| 62 | options = normalizeOptions(rawOptions, this); |
| 63 | } catch (error) { |
| 64 | callback(error); |
| 65 | |
| 66 | return; |
| 67 | } |
| 68 | |
| 69 | const plugins = []; |
| 70 | const replacements = []; |
| 71 | const exports = []; |
| 72 | |
| 73 | if (shouldUseModulesPlugins(options)) { |
| 74 | plugins.push(...getModulesPlugins(options, this)); |
| 75 | } |
| 76 | |
| 77 | const importPluginImports = []; |
| 78 | const importPluginApi = []; |
| 79 | |
| 80 | let isSupportAbsoluteURL = false; |
| 81 | |
| 82 | // TODO enable by default in the next major release |
| 83 | if ( |
| 84 | this._compilation && |
| 85 | this._compilation.options && |
| 86 | this._compilation.options.experiments && |
| 87 | this._compilation.options.experiments.buildHttp |
| 88 | ) { |
| 89 | isSupportAbsoluteURL = true; |
| 90 | } |
nothing calls this directly
no test coverage detected