Replies: 1 comment 1 reply
-
By "all modules in one folder merged" you mean something like concatenating them without anything else? So you're using global variables a lot? The usual workflow would be to use imports and exports to build your app (in a hierarchical way), and have a single entry point which you could then pass to a bundler to create a single output file. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
What I want to do seems easy at fist glance, but gets rather complicated in the real world.
I have a (right now) small web-app. For reasons a bit complicated to explain, what I want ist this:
I need a main.js file containing all the basic functionality, I want it to be one single file. (I don't cars for minification).
The main file is already about 3000 lines long, and I really would like (need) to have it split for development.
I program in TypeScript, using VS-Code.
For the first stages I just used a tsconfig.json with outputfile set. Next step i want to ad ES6 or even ES2022 Modules for separating individual functionalities per client/customer etc.
tsconfig with modules for ES6 enabled does not allow outputfile. I went for two different tsconfigs in the main folder and in the modules folder, but as soon a one import statement appears in the main folder's files, the TS compiler ignores the tsconfig and won't compile.
So the only option for me right now is to import export the files in the main folder as ES6 modules too. So I end up with around 10 imports and that number of additional http requests.
Which I don't like for that reason alone, and the deployment process, and the sometimes need for browsers without ES6 module support - where we will provide only the main.js functionality anyhow.
So what I'm asking, as I simply wasn't able to understand that by doing research including reading a lot of the docs :
Can i use Parcel with a reasonable overhead to my development process, to get all the (TS) modules in one folder merged into one file, while keeping them as separate modules, when they are in a subfolder? (Doing the merge with the transpiled js files only would likely also work.)
(PS.: I don't want to and don't need to use Node.js of any other library.)
PPS.: Thanks for your time. And If you have any other suggestion for tools or simply setups, compiler options etc. that you can think of, I'll be very grateful.)
Beta Was this translation helpful? Give feedback.
All reactions