Update import.macro.js

Fixing an issue where if, `babelMacros` is not set in `package.json`, then there is an error `"config license must be either 'free' or 'pro'"` because `config = {}`. We need to check for the `license` (`config.license`).
This commit is contained in:
Dimitry Kudryavtsev 2022-02-17 13:30:27 -06:00 committed by GitHub
parent 65f4bdb502
commit 2c67dae2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ const styles = [
]
function importer ({references, state, babel, source, config}) {
const license = (config !== undefined ? config.license : 'free')
const license = ((config !== undefined && config.license !== undefined) ? config.license : 'free')
if (!['free', 'pro'].includes(license)) {
throw new Error(