4

Is it possible to trasnspile js files with React.NET in order to user es6 features in js files in browser that support es5?

I use React.NET in a ASP.NET MVC project with React where it transpiles jsx files to js files through BabelBundle but if I add a js file to the bundle, using the ASP.NET Bundling and Minification library, it is no being transpiled because it is already a js file, for example:

bundles.Add(new BabelBundle("~/bundles/myBundle").Include(
    "~/Scripts/React/Component1.jsx",
    "~/Scripts/jsFile.js
));

In the above case, Component1.jsx is being transpiled but jsFile.js is not transpiled and so it is not possible to use es6 features in browsers that support only es5.

The issue occures only when in Debug configuration when bundles aren't created (because bundling is not enabled).

Is it possible to configure React.NET babel version to transpile js files as well?

Avi K.
  • 1,734
  • 2
  • 18
  • 28

0 Answers0