I don’t often develop web sites but when I do I use Aurelia. So I’m back at it again and I thought after updating my npm packages with the latest babel and the latest preset-env that this problem would go away. Every time I try to compile anything like the below code it blows up on the first equals sign. I ultimately end up relenting, creating a constructor and make the same assignments to ‘this’ inside the constructor. But I’m curious as to why I can’t seem to use ESNext while everything else I’m doing seems to work fine for my purposes.
export class App {
products = [
{ id: 0, name: ‘Motherboard’ },
{ id: 1, name: ‘CPU’ },
{ id: 2, name: ‘Memory’ },
];
selectedProductId = null;
}
Here is a snippet from my gulp file that invokes babel with the env preset.
gulp.task(‘compile-to-war’, function() {
return gulp.src(paths.files_to_compile).pipe(babel({ presets: [‘env’]})).pipe(gulp.dest(paths.war));
});
And some dev dependencies from my package Json.
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",