Sanshain / preact-boilerplate

preact boilerplate
0 stars 0 forks source link

Old browser support for redux-toolkit... #10

Open Sanshain opened 2 months ago

Sanshain commented 2 months ago

Faced with a problem on redux-toolkit cimpilation in runtime (chromium 50):

Uncaught SyntaxError: Unexpected token ?

on line:

const contextMap = gT[ContextKey] ?? (gT[ContextKey] = /* @__PURE__ */ new Map());

Double question mark becames a problem. I tried to avoid the problem via babel/preset like this:

    [
      "@babel/preset-env",
      {
        "targets": {
          "chrome": "50",
          "ie": "11"
        }
      }
      // "@babel/react"
    ]

I would supposed it will work like in svelte es5 template. But failed.

Also at the same time I tried do it via setting "target": "ES5" within tsconfig.json. But still failed.

Trouble

Representetive example is here.

Sanshain commented 2 months ago

via babel/preset

According documentation it is possible. But for some reason doesn't work.