I'm trying to run two separate groups of tasks for the same files in order to produce two different builds. One of the tasks is grunt-browserify. I also use grunt-preprocess in order to remove parts for each build. In one of them, I remove a require of a module that I don't want Browserify to process.
// @if env='PROD'
var chrome = require('chrome');
// @endif
The processed file doesn't have the line, but somehow Browserify still thinks it is required and packs it in the bundle.
But nothing worked. The module always shows up in the bundle.
I really can't figure out why the browserify task thinks it should include it...
You are probably including indirectly that chrome file, because of an alias.
Make sure that no one of your aliases (if you are using any) is referring to unprocessed files.