phenomnomnominal/angular-2-local-storage

404 /angular-2-local-storage not found and systemjs.config.js

ajitatif opened this issue · 2 comments

Hi,

I had to add

map { 
    ..., 
    'angular-2-local-storage': 'npm:angular-2-local-storage/dist'
}, 

and

packages: {       
    ..., 
    'angular-2-local-storage': { main: './angular-2-local-storage.js', defaultExtension: 'js' } 
}

to get angular-2-local-storage work as documented.

Otherwise I got 404 for /angular-2-local-storage requests.

Using v0.0.20 from via npm install.

I'm relatively new to all this npm and SystmJS stuff (been living in a cave for about five years now) so I just wanted to know if this is a "it's not a bug, it's a feature" case.

We're using WebPack now with the latest angular-cli. However when we were on the older version, we had to add similar config to what you have above for most of our 3rd party dependencies.

I've updated the documentation to reflect this. For reference, here is the original notes from README.md:


Add the following to your map and packages arrays in src/system-config.ts:

    const map: any = {
        'angular-2-local-storage': 'vendor/angular-2-local-storage'
    };
    const packages: any = {
        'angular-2-local-storage': { main: 'index.js', defaultExtension: 'js' }
    };

And then add the following to vendorNpmFiles in angular-cli-build.js:

    vendorNpmFiles: [
        'angular-2-local-storage/**/*.js'
    ]

For me with angular2 example project and systemjs works:

const map: any = {
'angular-2-local-storage': 'vendor/angular-2-local-storage/dist'
};