Requirement for manual install of babel-preset-es2015
Created by: andreypopp
Babel is configured to run with es2015
preset but no dependency is declared in sweet.js
package.
That results in:
mb % ./node_modules/.bin/sjs ./test.js ~/Workspace/sweet-playground
/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372
throw new Error("Couldn't find preset " + JSON.stringify(val) + " relative to directory " + JSON.stringify(dirname));
^
Error: Couldn't find preset "es2015" relative to directory "/Users/andreypopp/Workspace/sweet-playground"
at /Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17
at Array.map (native)
at OptionManager.resolvePresets (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
at OptionManager.mergePresets (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
at OptionManager.mergeOptions (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
at OptionManager.init (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)
at File.initOptions (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/index.js:194:75)
at new File (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/file/index.js:123:22)
at Pipeline.transform (/Users/andreypopp/Workspace/sweet-playground/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
at Object.compile (/Users/andreypopp/Workspace/sweet-playground/node_modules/sweet.js/dist/sweet.js:79:70)
I think the the right fix would be to remove es2015
preset configuration and let users configure Babel themselves (via .babelrc
or "babel"
key in package.json
).