-
Notifications
You must be signed in to change notification settings - Fork 122
Issue bundling RXJS 5 #826
Comments
Firstly, using package config is the right approach. You need to point rxjs to the subdirectory containing the output. That error comes from the Builder directly trying to parse an esm source file. |
@aluanhaddad thanks for the response. It had occurred to me that i could possibly just target and transpile the typescript source instead, but i was unaware of However having now installed and configured it, unfortunately i'm still getting the same |
Could you please elaborate on what you mean by this, I'm not sure i understand? |
After removing the wildcards from the I ended up finding 2 seperate The fix for this issue was the one that @aluanhaddad suggested, but i'd possibly misunderstood. Which was to configure the offending package (the one the |
@jamesbrobb I meant that since
What i meant was that the error { SyntaxError: path/to/MyEnum.ts: 'import' and 'export' may appear only with 'sourceType: module' (3:0)
1 |
2 |
> 3 | export enum MyEnum {
| ^
4 | do_a,
5 | do_b
6 | } implies that babel is being used to transpile an |
Thanks @aluanhaddad
But is this something that can be used within a production environment? |
I'm starting to feel like a dog chasing his tail. Every time i fix one thing, it seems to just create another issue. In order to fix the initial problem, i removed the wildcards from the So:
has become:
According to the depreciation warnings, this is now the correct way to configure a 'wildcard' path, by just leaving a trailing slash. But in order to get it to correctly target
But using this format adds So whereas when using wildcards (if it had worked) the output would be:
Without the wildcards and only a trailing slash and
and using
Am i doing something wrong here? |
It is true that the wildcard configuration is deprecated, but you are using an older version of the builder and an older version SystemJS... The simplest way to make the app work is to just reference one of the bundled versions of RxJS. Looking at your configuration again, it seems you are using
No, but when you run a build/bundle, the TypeScript will be transpiled. |
The latest version of systemjs-builder doesn't use the latest version of
systemjs, it uses 0.19.47. And I'm unable to upgrade to the latest version
of systemjs due to another issue that's been introduced relating to rxjs
(which I don't have access to on my phone at the moment).
By 'rxjs bundle' do you mean use the entire rxjs library by loading
Rx.min.js?
Regardless, why is '.ts' now being added to the registry keys and import
paths? Is that actually a conscious, deliberate decision?
…On 7 Aug 2017 16:29, "Aluan Haddad" ***@***.***> wrote:
It is true that the wildcard configuration is deprecated, but you are
using an older version of the builder and an older version SystemJS...
The simplest way to make the app work is to just reference one of the
bundled versions of RxJS.
Looking at your configuration again, it seems you are using paths config
where you should be using map config.
or you can configure plugin-typescript to load it and transpile it on the
fly
But is this something that can be used within a production environment?
No, but when you run a build/bundle, the TypeScript will be transpiled.
Regardless, this is an advanced scenario.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq8tQ0lnu87XTWvKKVRqCCpkW460FOgks5sVy1UgaJpZM4OmrZ7>
.
|
I've also never been able to get maps to work in a systemjs-builder config,
only when using systemjs to load files.
Please can you give me an example of what a maps configuration would look
like to fix this issue?
…On 7 Aug 2017 16:29, "Aluan Haddad" ***@***.***> wrote:
It is true that the wildcard configuration is deprecated, but you are
using an older version of the builder and an older version SystemJS...
The simplest way to make the app work is to just reference one of the
bundled versions of RxJS.
Looking at your configuration again, it seems you are using paths config
where you should be using map config.
or you can configure plugin-typescript to load it and transpile it on the
fly
But is this something that can be used within a production environment?
No, but when you run a build/bundle, the TypeScript will be transpiled.
Regardless, this is an advanced scenario.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq8tQ0lnu87XTWvKKVRqCCpkW460FOgks5sVy1UgaJpZM4OmrZ7>
.
|
No, but when you run a build/bundle, the TypeScript will be transpiled.
R egardless, this is an advanced scenario
I'm sorry i'm confused. The problem I'm trying to solve is to build/bundle
for a production environment. Are you suggesting that using
plugin-typescript to transpile on the fly, is or isn't a possible solution
for this specific problem? I have no issues with current systemjs
configuration in my dev environment.
…On 7 Aug 2017 16:29, "Aluan Haddad" ***@***.***> wrote:
It is true that the wildcard configuration is deprecated, but you are
using an older version of the builder and an older version SystemJS...
The simplest way to make the app work is to just reference one of the
bundled versions of RxJS.
Looking at your configuration again, it seems you are using paths config
where you should be using map config.
or you can configure plugin-typescript to load it and transpile it on the
fly
But is this something that can be used within a production environment?
No, but when you run a build/bundle, the TypeScript will be transpiled.
Regardless, this is an advanced scenario.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq8tQ0lnu87XTWvKKVRqCCpkW460FOgks5sVy1UgaJpZM4OmrZ7>
.
|
@jamesbrobb I want to apologize for any confusion my remarks have caused.
What I mean is that targeting the TypeScript source of a third party package, compiling them from source is, whether for development or for production and whether bundling or not bundling, an advanced scenario. A. I am building for production and wish to reduce code size by using plugin-typescript, together with the systemjs-builder's rollup support, to optimize the size of my bundle. B. I want to use the source code of RxJS for debugging purposes. |
Versions
systemjs:
0.19.47
systemjs-builder:
0.15.34
typescript:
2.3.0
rxjs:
5.4.2
Issue
I have this combination working in my dev environment - transpiling, loading and passing tests in Karma and loading all files individually in the browser - but am having problems bundling RXJS for my production build.
tsconfig.json
Gulp task code:
SystemJs config:
With this configuration i get the following error:
The offending RXJS code (in this instance at least - the error appears to relate to any rxjs file that is required within one of their files)
Attempted fix
I've tried removing the wildcards from the the
rxjs
path and adding a packages definition, which appears to possibly fix this issue, but unfortunately it results in a completely different error.So in the config this:
changes to this:
plus the addition of:
Error after changes
The text was updated successfully, but these errors were encountered: