Comments (4)
I'll make a pull request later.
from blendid.
Except that, having located the offending require('underscore')
, I find myself at a loss as to what purpose it serves.
There's a comment in package.json
that goes:
The following 'underscore' example demonstrates exposing a module included by another module. If you were to
npm install underscore
separately andrequire('underscore')
, you'd end up with two copies in your bundle. The one you installed, and the one that shipped with another package (backbone in this example). This is an edge case and should rarely happen.The 'plugin' example makes that file requireable with
require('plugin')
, and available to browserify-shim as 'plugin' on line 30.
If I understand this correctly, it's saying that ... well, I haven't actually figured it out. How would backbone be installing its own copy of underscore without npm or bower?
I guess I'm asking, what purpose does this aliasing of underscore
to backbone/node_modules/underscore
accomplish?
from blendid.
so when you npm install backbone
, it brings its own copy of underscore with it. You can see it if you open up node_modules/backbone
- you'll see underscore in there. If the only thing you required in a js file was backbone
, and you opened up the compiled file, you'd see backbone.js AND underscore.js in the bundle. If you also npm install underscore
, and require 'underscore'
, you'd end up with backbone's copy + the copy you installed from npm. It's an edge case I ran into, and I thought I'd call it out here. I know it's not super clear though. I may end up yanking that example since most people just get confused by it. Make sense?
from blendid.
That does make sense now.
...
It also sheds more light on your comment the other day. Thanks for the followup!
from blendid.
Related Issues (20)
- watch task will not compile more than 48 html files HOT 5
- Removing "comments" from public/html files HOT 1
- xlink:href being deprecated in SVG
- Additional Tasks information HOT 4
- Build issue: UglifyJs - Unexpected token: name (context)
- Build issue: UglifyJs - Unexpected token: name (context) HOT 5
- Fonts aren't copied over on build HOT 1
- additionalTasks access rev-manifest HOT 4
- Not bundle jquery in production HOT 1
- Current project status HOT 4
- 4.5.0 release not available through npm/yarn HOT 1
- Failed to mount component: template or render function not defined HOT 1
- upgrade to gulp 4
- empty prebuild and postbuild configs must be `null`/`false`, not `[]`. change this behavior?
- html watch task does not notice changes to files added after Blendid was started
- wrong generation of path for js-files in rev-manifest on windows HOT 1
- Configuration for swiper to work
- The engine "node" is incompatible with this module HOT 3
- 4.5.3 release not available through npm HOT 1
- ERROR in bundle.js from UglifyJs Unexpected token: name (ChangeDesc) [bundle.js:2900,6]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blendid.