I'm facing a dilemma with my current setup as I'm dealing with a headache. Here's how things are currently configured:
- Utilizing bower to acquire vendor libraries (specifically angular)
- Executing gulp tasks to run browserify
- Implementing debowerify to ensure compatibility of bower libraries with browserify
App.js (pre-browserify):
'use strict';
var angular = require("angular");
var Routes = require("./routes");
angular.module('MyAngularApp')
.config(Routes);
App.js (post-browserify/in the bundle.js):
var angular = require("./../ext/angular/angular.js");
var Routes = require("./routes");
angular.module('MyAngularApp')
.config(Routes);
Seems like everything is set up correctly so far, right? Debowerify appears to have successfully replaced angular
with the relative path to angular.js
from bower.
However, upon debugging the bundle.js
in the browser console, after executing the initial two require
lines (for angular
and Routes
), angular
turns out to be an empty object, while Routes
is indeed the correct function that was set up in the export.
Question: Why is angular
not being imported correctly using the require
function?
I added this to my package.json
in order to make debowerify
functional:
"browserify": {
"transform": [
"debowerify"
]
},