Jump to content

TypeScript Project - SystemJS


royibernthal
 Share

Recommended Posts

I'm trying to create a new TypeScript project around Pixi.

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 { Sprite, Texture } from 'pixi.js';

-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 pixi.js 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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...