ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Can't load webpack ES6 config #164

Open vinhlh opened 7 years ago

vinhlh commented 7 years ago
Failed to start server:
/Users/vinhlh/my-project/webpack/config.dev.babel.js:1
(function (exports, require, module, __filename, __dirname) { import webpack from 'webpack'
                                                              ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getResolver (/Users/vinhlh/Library/Application Support/Sublime Text 3/Packages/tern_for_sublime/node_modules/tern/plugin/webpack.js:27:67)
nickw444 commented 7 years ago

I believe this has to do with this library not using babel-register:

https://www.npmjs.com/package/babel-register

The require hook will bind itself to node's require and automatically compile files on the fly.