dmnsgn / frontend-boilerplate

An ES20XX starter with common frontend tasks using Webpack 5 as module bundler and npm scripts as task runner.
227 stars 36 forks source link

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0) #17

Closed dmnsgn closed 6 years ago

dmnsgn commented 7 years ago

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)

Solution: Change the order of transforms, moving babelify in the first position of the transform array in the package.json:

  "browserify": {
    "transform": [
      "babelify",
      "aliasify",
      "brfs"
    ]
  },
kirylrb commented 6 years ago

devDependencies need "babelify": "^8.x.x" also as well.