Sanshain / preact-boilerplate

preact boilerplate
0 stars 0 forks source link

pragma and pragmaFrag cannot be set when runtime is automatic. > 1 | export default "__ROLLUP__PREFLIGHT_CHECK_DO_NOT_TOUCH__" #8

Closed Sanshain closed 2 months ago

Sanshain commented 2 months ago

Trouble:

pragma and pragmaFrag cannot be set when runtime is automatic. 1 | export default "ROLLUPPREFLIGHT_CHECK_DO_NOT_TOUCH__"

Reason:

Using pragme options while using "runtime:" "automatic" within @babel/transform-react-jsx. For example:

    [
      "@babel/transform-react-jsx",
      {
        "pragma": "h",
        "pragmaFrag": "Fragment",
        "runtime": "automatic",
        "importSource": "preact"   
      }
    ]

Solution:

Remove pragma options from config:

    [
      "@babel/transform-react-jsx",
      {
        // "pragma": "h",
        // "pragmaFrag": "Fragment",
        "runtime": "automatic",
        "importSource": "preact"   
      }
    ]