I have used create-react-app for my project. I am getting an error of
Uncaught SyntaxError: Unexpected token export
The error is in this code
export const ENGLISH = {
  lang: 'en',
  messages: {
      'nav.translatedMessage': 'Social',
  }
};
I tried installing babel-preset-es2015 and babel-preset-stage-0. Also i included the babel dict/object in package.json as
"babel": {
    "presets": [
      "es2015",
      "stage-0"
    ]
  },
I am still getting an error.

I got my answer on README.md of create-react-app. There it says
You may create subdirectories inside
src. For faster rebuilds, only files insidesrcare processed by Webpack.
You need to put any JS and CSS files insidesrc, or Webpack won’t see them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With