is it possible to develop and deploy plugin with typescript ts and then compile it with js?
-
When developing a nodebb plugin, is it possible to develop and deploy plugin with typescript and then compile it with js?
I have also roughly checked the nodebb core source code, and I expect that there will be no major problems if I deploy the plugin using js build after developing ts. However, is there any experience or advice on developing and distributing the nodebb plugin using ts?
Eventual migration to TypeScript
@julian I think it might be possible with some build tooling magic... Importing plugins using CJS is as you mentioned the easy part - await import() works bo...
NodeBB Community (community.nodebb.org)
Adding TypeScript-support to your Node.js project
Many Node.js projects will reach a level of complexity where we'll often find ourselves wondering... Tagged with node, typescript, javascript, tutorial.
DEV Community (dev.to)
Node.js, require.main === module
In Node.JS document, I found a sentence said When a file is run directly from Node.js, require.main is set to its module. That means that it is possible to determine whether a file has been run
Stack Overflow (stackoverflow.com)
require.main.require imports do not work · Issue #19117 · microsoft/TypeScript
TypeScript Version: 2.6.0-dev.201xxxxx From: microsoft/vscode#35489 (comment) Code const myModule = require.main.require('./file.js') Run go to definition on myModule Expected behavior: Goes to defintion of myModule Actual behavior: Noth...
GitHub (github.com)
-
It appears that Svelte was used when developing the acp admin dashboard part - https://github.com/NodeBB/nodebb-plugin-emoji/blob/master/acp/src/EmojiList.svelte
https://github.com/NodeBB/nodebb-plugin-emoji/blob/master/acp/rollup.config.mjs⇒ When developing acp admin dashboard, can I use [svelte, react]? What if I set the ts compile option to amd commonjs?
⇒ When developing a theme, can I use [svelte, react]? What if I set the ts compile option to amd commonjs?
nodebb-plugin-emoji/acp/rollup.config.mjs at master · NodeBB/nodebb-plugin-emoji
NodeBB Plugin enabling emoji as seen on http://www.emoji-cheat-sheet.com - nodebb-plugin-emoji/acp/rollup.config.mjs at master · NodeBB/nodebb-plugin-emoji
GitHub (github.com)