Open sergejmueller opened 8 years ago
I'm using acorn and acorn-walk. Maybe there's a way to make it support ES6?
I don't know. A another acorn-walk plugin? https://npmdaily.com/search/acorn
This may not work for your use case, but I transpile to ES5 using Babel and then use optimize-js.
@rich-harris would switching to https://www.npmjs.com/package/estree-walker solve this?
@nolanlawson yes
esprima has nice support of es6 and es7 https://github.com/jquery/esprima https://github.com/estools/estraverse https://github.com/estools/escodegen
this is already patched with the use of estree-walker.
Question: wouldn't it just be possible to give acorn different options? For instance, imports/exports should work just fine if the sourceType: 'module'
option was provided.
Perhaps because
walk.js
does not support ES6?Example: start.js.txt