question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SystemJs compatibility and bundle distribution

See original GitHub issue

We have few problems integrating your library. The first is the compatibility with SystemJs…second we don’t have any “bundle” file.

For the first we use tsconfig.json with:

 "target": "es5"
 "module": "system",

So we actually get always Uncaught ReferenceError: require is not defined.

For the second problem we are developing a solution using Visual Studio 2015 and we have node_modules directory outside “wwwroot” so we have to move files directly into a folder named libs inside wwwroot. For example we have the “angular2.dev.js” file …now we really need to have a single bundled file to be used otherwise it will be a “mess”…i guess. What do you think?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
ignaciolarranagacommented, Feb 12, 2016

I think this might be a solution:

System.config({
    packages: {
        app: {
            format: 'register',
            defaultExtension: 'js'
        },
        'ng2-translate': {'defaultExtension': 'js'},
        'rxjs': {'defaultExtension': 'js'}
    },
    map: {
        ng2-translate': 'node_modules/ng2-translate',
        'rxjs': 'node_modules/rxjs'
    }
});
1reaction
ocombecommented, Jan 18, 2016

You can check the 2 examples starters that updated with ng2-translate, maybe that will help you since they both use SystemJS: https://github.com/ocombe/ng2-play/tree/ng2-translate & https://github.com/ocombe/angular2-seed/tree/ng2-translate

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - SystemJS: loading build file - Stack Overflow
1 Answer 1 ... When you transpile to a single file, it produces a file in a special format called 'bundle'. When you...
Read more >
How to create an Angular Component Library - SystemJs and ...
In this post we are going to see how an Angular component library can be built and then consumed using both SystemJs and...
Read more >
Understanding (all) JavaScript module formats and tools
Fortunately, now JavaScript has standard built-in language features for modules, and it is supported by Node.js and all the latest modern ...
Read more >
Distributing an Angular Library - The Brief Guide
Should be bundled and distributed. ... When developers use our package in development with SystemJS their ... Compatible with compiler.
Read more >
Build for production - Lit.dev
There are many ways to set up Rollup to bundle your project. ... widest range of browsers with a single build, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found