Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Code not compiling to ES5 #988

Closed isaac-martin closed 5 years ago

isaac-martin commented 5 years ago

Problem

Code appears to not be compiling to IE / Edge (ES5). Am getting error SCRIPT1028 in console.

Have defined "browserslist": "> 0.25%" in package.json and when running npx browserslist get the below output.

and_chr 71
and_uc 11.8
android 4.4.3-4.4.4
chrome 71
chrome 70
chrome 69
chrome 63
chrome 61
chrome 49
edge 17
firefox 64
ie 11
ios_saf 12.0-12.1
ios_saf 11.3-11.4
ios_saf 11.0-11.2
ios_saf 10.3
ios_saf 8
op_mini all
opera 57
safari 12
safari 11.1
samsung 4

Not sure if something in my configs have changed?

isaac-martin commented 5 years ago

Worth noting my '.babelrc` file looks like this, I have react running inside a particular page.

{
  "presets": ["@babel/preset-react"],
  "plugins": [["transform-async-to-generator"], ["@babel/plugin-syntax-object-rest-spread"], ["@babel/plugin-proposal-class-properties"]]
}
isaac-martin commented 5 years ago

Can't find anything in the documentation, but does having a '.babelrc' overwrite any slate configs?

isaac-martin commented 5 years ago

Looks like it was an issue with my config setup. Changed my .babelrc to be the following for anyone that comes across this.

{
  "presets": [
    "@babel/preset-react",
    [
      "@babel/preset-env",
      {
        "targets": "> 0.25%, not dead"
      }
    ]
  ],

  "plugins": [["transform-async-to-generator"], ["@babel/plugin-syntax-object-rest-spread"], ["@babel/plugin-proposal-class-properties"]]
}
lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.