I am facing an issue with exporting an enum object as default at the top level in my code. Here is what I tried:
export default enum Hashes{
FOO = 'foo',
BAR = 'bar',
}
However, this resulted in an error message:
Module parse failed: Unexpected token (1:15) File was processed with these loaders: [02:54] MABROUK, Sahnoun (external - Project)
- ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
- ./node_modules/@ngtools/webpack/src/ivy/index.js
I then attempted a different approach:
export enum Hashes{
FOO = 'foo',
BAR = 'bar',
}
This worked, but required me to import Hashes as an alias in all my components like this:
import {Hashes} from ... which has caused significant changes in my project!
Is there any alternative solution to this problem?