Closed frederikschubert closed 8 years ago
Do you want to just import @angular/core/bundles/core-testing.umd.js
then?
Yes. I would like to map @angular/{core,platform-browser,compiler,etc.}/testing
to @angular/core/bundles/{core,platform-browser,compiler,etc.}-testing.umd.js
.
Are you on jspm 0.17 or 0.16?
0.17.0-beta.28
Then you can edit jspm_packages/npm/@angular/core@x.y.z.json
and add the line:
"map": {
"./testing": "./bundles/core-testing.umd.js"
}
and the same for the others.
Ah that works! I tried adding a mapping but didn't find any documentation on the syntax. I guess that those mappings should be added to the registry? I would like to make a PR! Thank you for your help! Greatly appreciate what you are doing for this project.
A PR with the necessary configs for Angular is welcome.
I am on JSPM 0.16 and now when I install @angular/core
a testing.js
file is written with the following:
module.exports = require('@angular/core@2.4.7/bundles/core-testing.umd/index');
This causes module loading failures at runtime.
How can I prevent /index
from being appended in this file? If I remove it manually it works fine.
Thanks
Hello, I'm having the exact same issue but I use jspm 0.16. Is there any way to map to the correct file from the bundles folder instead of testing.js?
@GinaLazar you could install it with an override but this should not be necessary. For example, you could run
jspm install @angular/core=npm:@angular/core --override override.json
where override.json
contains
{
"map": {
"testing.js": "bundles/core-testing.umd.js"
}
}
Angular updated their publishing directory structure since RC 6 and it is not possible anymore to import from
@angular/core/testing
as JSPM tries to fetchjspm_packages/npm/@angular/core@2.0.0/testing.js
where it should be fetchingjspm_packages/npm/@angular/core@2.0.0/bundles/core-testing.umd.js
. The main entry already points tobundles/core.umd.js
and the mapping for testing should be analogous.I tried to import from
@angular/core/testing/index
but that doesn't work either because then the imports from the successfully fetched core module to other modules like@angular/compiler/testing
will fail.Related to https://github.com/jspm/jspm-cli/issues/2080