Some of the source files that one uses Babel on have extensions other than .js. For example, Typescript files end with .ts, and you can also have .jsx and .tsx. These extensions are expected by the IDEs, which use them to determine the language of the file.
However, without special setup, these extensions are not associated by the web server with the text/javascript MIME type, so when you try to put them into a script tag on your web page, you get an error: "blocked because of a disallowed MIME type."
Therefore, it would be very convenient if the plugin could allow renaming the translated files such as myFile.ts to myFile.js.
I have submitted a pull request (#20) that provides one way of doing this - not sure if it's the best way, but can hopefully be a start.
Interesting, wouldn't that broke the overall script? I mean how strict Babel is if it comes to file extensions?
Could you provide some tests for this? Thanks for contribution!
Some of the source files that one uses Babel on have extensions other than .js. For example, Typescript files end with .ts, and you can also have .jsx and .tsx. These extensions are expected by the IDEs, which use them to determine the language of the file.
However, without special setup, these extensions are not associated by the web server with the text/javascript MIME type, so when you try to put them into a script tag on your web page, you get an error: "blocked because of a disallowed MIME type."
Therefore, it would be very convenient if the plugin could allow renaming the translated files such as myFile.ts to myFile.js.
I have submitted a pull request (#20) that provides one way of doing this - not sure if it's the best way, but can hopefully be a start.