1
Why does the code below not work? I am using the import
/export
in the standard ES6 in a Node.js environment with sucrase.
Filing cabinet config.js
:
const token = 'example';
export default { token };
Any other file:
import { token } from './config';
Using the syntax you passed, the config.js file would have several "export const" commands. I don’t know if this is a legibility problem, but there is some way to export several constants in a single command and that can be recovered later as if it were a breakdown?
– Augusto Lima
With the current module syntax of ES6, I think not... I will check later and as it is, edit my answer.
– Luiz Felipe
I was able to do it with "export {valor1, valor2}". I had tested before, but Eslint was accusing style error and I thought it was code problem.
– Augusto Lima