ngrx / store-devtools

Developer Tools for @ngrx/store
MIT License
325 stars 38 forks source link

ngrx/devtools import with SystemJS not working. #10

Closed bertrandg closed 8 years ago

bertrandg commented 8 years ago

Thanks for these great tools! I use ngrx/store@1.3.3 with systemJS and it works very well. But I just tried to add ngrx/devtools@1.3.3 exactly the same way and it fails with this error: GET http://localhost:3000/node_modules/@ngrx/store/dist/dist/store-backend.js 404 (Not Found)

Here is my systemJS config:

    System.config({
        packages: {
            src: {
                format: 'register',
                defaultExtension: 'js'
            },
            '@ngrx/store': {
                main: 'index.js',
                format: 'cjs'           
            },
            '@ngrx/devtools': {
                main: 'index.js',
                format: 'cjs'           
            } 
        },
        map: {
            '@ngrx/store': 'node_modules/@ngrx/store/dist',
            '@ngrx/devtools': 'node_modules/@ngrx/devtools/dist'
        }
    });

That's weid because store-backend.js is loaded correctly from http://localhost:3000/node_modules/@ngrx/store/dist/store-backend.js when I don't use/import @ngrx/devtools..

Any ideas how to solve it?

brandonroberts commented 8 years ago

Here is a working SystemJS config example. You would replace the npmcdn path with your node_modules path.

https://github.com/ngrx/store/issues/18#issuecomment-195893273

bertrandg commented 8 years ago

Nice, it works! :) Here is my config for others:

System.config({
    packages: {
        src: {
            format: 'register',
            defaultExtension: 'js'
        },
        '@ngrx/store': {
            main: 'dist/index.js',
            format: 'cjs'           
        },
        '@ngrx/devtools': {
            main: 'dist/index.js',
            format: 'cjs'
        } 
    },
    map: {
        '@ngrx': 'node_modules/@ngrx'
    }
});