I'm trying to create a new TypeScript project.
I'd like it to be as straightforward and lightweight as possible without any unnecessarily complex configurations, while meeting these requirements:
-Using npm
-Using TypeScript
-Using import statements, e.g.
import { A, B } from 'module';
-Bundle all dependencies from node_modules that were imported using import statements into /build for production
-Compile project source into a single outFile and put it in /build
-Load dependencies at runtime according to imports made using import statements
-Using SystemJS, since I understood it's in the process of becoming the standard module loader
So far I created a new project:
-Used npm - installed a framework and its typings for TypeScript
-Compiling using tsc (tsconfig.json) via Visual Studio Code
-tsconfig.json "module": "system" (SystemJS)
-I can write import statements (since module is set to "system")
-tsconfig.json "outFile": "../build/app.js" - compiles project source into a single outFile and puts it in "build" dir
What I'm missing is:
-Bundle all dependencies from node_modules that were imported using import statements into /build for production
-Load dependencies at runtime according to imports made using import statements
I don't have any experience with setting up and configuring module loaders.
Could you please help point me in the right direction?
Searching any of these subjects brings up results and npm modules I could use, but things can get too complex too fast and it'll take me too much time playing around to understand what I'm doing and what needs to be done, so any advice from someone who knows how to best approach this would be much appreciated.