| | |
| | | function _loader() { |
| | | _loader = _asyncToGenerator(function* (source, inputSourceMap, overrides) { |
| | | const filename = this.resourcePath; |
| | | let loaderOptions = loaderUtils.getOptions(this) || {}; |
| | | let loaderOptions = loaderUtils.getOptions(this); |
| | | validateOptions(schema, loaderOptions, { |
| | | name: "Babel loader" |
| | | }); |
| | |
| | | |
| | | const programmaticOptions = Object.assign({}, loaderOptions, { |
| | | filename, |
| | | inputSourceMap: inputSourceMap || undefined, |
| | | inputSourceMap: inputSourceMap || loaderOptions.inputSourceMap, |
| | | // Set the default sourcemap behavior based on Webpack's mapping flag, |
| | | // but allow users to override if they want. |
| | | sourceMaps: loaderOptions.sourceMaps === undefined ? this.sourceMap : loaderOptions.sourceMaps, |
| | |
| | | }); |
| | | } else { |
| | | result = yield transform(source, options); |
| | | } // TODO: Babel should really provide the full list of config files that |
| | | // were used so that this can also handle files loaded with 'extends'. |
| | | } // Availabe since Babel 7.12 |
| | | // https://github.com/babel/babel/pull/11907 |
| | | |
| | | |
| | | if (typeof config.babelrc === "string") { |
| | | this.addDependency(config.babelrc); |
| | | if (config.files) { |
| | | config.files.forEach(configFile => this.addDependency(configFile)); |
| | | } else { |
| | | // .babelrc.json |
| | | if (typeof config.babelrc === "string") { |
| | | this.addDependency(config.babelrc); |
| | | } // babel.config.js |
| | | |
| | | |
| | | if (config.config) { |
| | | this.addDependency(config.config); |
| | | } |
| | | } |
| | | |
| | | if (result) { |