Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ Question ] How to get babel working to support imports? #370

@jhartma

Description

@jhartma

What are you trying to achieve?

I want to use es2015 import syntax

What do you get instead?

I tried the --compilers js:babel-core/register option which works fine with mocha, but I get a console error Unexpected token import

SyntaxError:                                                                                             
    at Object.exports.runInThisContext (vm.js:78:16)                                                     
    at Module._compile (module.js:543:28)                                                                
    at Object.Module._extensions..js (module.js:580:10)                                                  
    at Module.load (module.js:488:32)                                                                    
    at tryModuleLoad (module.js:447:12)                                                                  
    at Function.Module._load (module.js:439:3)                                                           
    at Module.require (module.js:498:17)                                                                 
    at require (internal/module.js:20:19)                                                                
    at .../node_modules/codeceptjs/node_modules/mocha/lib/mocha.js:222:27

Details

  • CodeceptJS version: 0.4.13
  • NodeJS Version: 7.4.0
  • Operating System: Linux (Arch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions