Allow projects to use an extension other than .ts
or .js
for the entrypoint module.
#5
Replies: 4 comments
-
I completely agree on this one - in the new webpack implementation (from RFC #2) the I added a note in the rfc:
|
Beta Was this translation helpful? Give feedback.
-
Ah yes, I support changing |
Beta Was this translation helpful? Give feedback.
-
Issues are prior-discussions, but for rfc's you can leave a 👍 on the PR #2 or comment etc. I feel like generally unless there is major opposition to an RFC - and the TSC also approves it (by leaving an approval on the PR), it can proceed to the "active" stage: |
Beta Was this translation helpful? Give feedback.
-
I'm closing this - as this is already working/included in the webpack RFC/changes. |
Beta Was this translation helpful? Give feedback.
-
NativeScript currently looks for an
{entry}.ts
or{entry}.js
file as its entrypoint and automatically loads it when the app starts, whereentry
is defined by themain
field inpackage.json
.Proposal: Allow any source file extensions supported by the Webpack configuration to be resolved; not just strictly
ts
andjs
.Prior work: I once opened a PR towards this (NativeScript/nativescript-dev-webpack#875), but the codebase has been refactored since then. It's still largely the same setup, though: https://github.com/NativeScript/nativescript-dev-webpack/blob/5e4936fc6ba9d6503c8fff3e4dd59e541f49d941/index.js#L76-L96
Benefit: This would allow React apps to use
app.tsx
or Svelte Native apps to useapp.svelte
as an entrypoint, allowing them to write TSX or Svelte syntax, etc. It's the only reason that React NativeScript has to use this bewilderingReact.createElement()
call instead of TSX syntax in the entrypoint:https://github.com/shirakaba/react-nativescript/blob/8327e29f3b6cd62446ba3ea9b84b3293983b07a0/sample/app/app.ts#L33
Beta Was this translation helpful? Give feedback.
All reactions