joeybaker / remapify

Alias directories for browserify
Other
117 stars 23 forks source link

Cannot find module: Watchify + Remapify #38

Closed eirikv closed 9 years ago

eirikv commented 9 years ago

I am having trouble using grunt-browserify and remapify with watch: true. It bundles just fine at first, but after a file is changed I get a Cannot find module error for every require that uses aliasMapping in that file.

I found a temporary workaround by just having the browserify task run from a cold start every time files are changed, but this is very time consuming (6-10 sec).

Here is my grunt-borwserify + remapify setup :

browserify: {
            options: {
                watch: true,
                transform: [['hoganify', { live: true }]],
                browserifyOptions: {
                    debug: true
                },
                plugin: [
                    ['remapify', [
                            {
                                src: '**/*.js',
                                expose: 'modules',
                                cwd: './src/main/modules'
                            }
                        ]
                    ]
                ]
            },
            app: {
                src: ['src/main/app.js'],
                dest: 'app/app.js'
            },
     }
joeybaker commented 9 years ago

Fixed in #39