Running a problem when merging two files in a browser (vendor.js and app.js into merged .js)
Downloading comb.js in the browser calls the following in _prelude.js:
Uncaught Error: Cannot find module 'function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}'
When downloading monitored files, it individually works fine.
What am I missing?
(let me know if you need more configs, we are pleased to provide)
Thank you for your help!
In the Gruntfile.js file:
browserify: { vendor: { src: ['client/requires/**/*.js'], dest: 'build/vendor.js', options: { shim: { jquery: { path: 'client/requires/jquery/js/jquery.js', exports: '$' }, underscore: { path: 'client/requires/underscore/js/underscore.js', exports: '_' }, backbone: { path: 'client/requires/backbone/js/backbone.js', exports: 'Backbone', depends: { underscore: 'underscore' } }, 'backbone.marionette': { path: 'client/requires/backbone.marionette/js/backbone.marionette.js', exports: 'Marionette', depends: { jquery: '$', backbone: 'Backbone', underscore: '_' } }, eventsource: { path: 'client/requires/eventsource/eventsource.js', exports: 'EventSource' }, moment: { path: 'client/requires/moment/moment.js', exports: 'moment' }, bootstrap: { path: 'client/requires/bootstrap/js/bootstrap.js', exports: null } } } }, app: { files: { 'build/app.js': ['client/src/main.js'] }, options: { transform: ['node-underscorify'], debug: true, external: ['jquery', 'underscore', 'backbone', 'backbone.marionette', 'eventsource', 'moment', 'bootstrap'] } }, }, concat: { 'build/<%= pkg.name %>.js': ['build/vendor.js', 'build/app.js'] },