Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-builder

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-builder - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

5

History.md
0.11.2 / 2013-12-30
==================
* fix main aliasing support
0.11.1 / 2013-12-30

@@ -3,0 +8,0 @@ ==================

35

lib/builder.js

@@ -820,12 +820,8 @@ /**

function register(builder, file, js){
var main = builder.config.main;
var orig = file;
// strip ./
if ('./' == file.slice(0, 2)) file = file.slice(2);
// rewrite main to index.js
// so that require() still grabs
// the correct file without aliases
if (file == main) file = 'index.js';
var main = builder.config.main;
var isMain = main == file;
var orig = file;

@@ -838,6 +834,8 @@ // determine prefix

// prefix
file = prefix + '/' + file;
// rewrite requires for dependencies,
// and fix relative requires when .main
// is not index.js
js = requires(js, function(require){

@@ -850,13 +848,28 @@ var deps = builder.config.dependencies || {};

// register the module
if (builder.sourceUrls) {
js = JSON.stringify(js + '//@ sourceURL=' + prefix + '/' + orig);
js = JSON.stringify(js + '//@ sourceURL=' + file);
js = js.replace(/\\n/g, '\\n\\\n');
return 'require.register("' + file + '", Function("exports, require, module",\n'
js = 'require.register("' + file + '", Function("exports, require, module",\n'
+ js
+ '\n));';
} else {
return 'require.register("' + file + '", function(exports, require, module){\n'
js = 'require.register("' + file + '", function(exports, require, module){\n'
+ js
+ '\n});';
}
// main support
// TODO: dear god, this is nasty, doesnt belong
// in here but doing a separate tree walk is lame
// so screw it, works for now, need to rewrite this thing
// once we produce a dep tree first then we can completely
// remove all of this junk, as we'll know what all the mains
// are and can simply rewrite
if (isMain && 'index.js' != orig) {
js += '\nrequire.main("' + prefix + '", "' + orig + '")';
}
return js;
}

@@ -863,0 +876,0 @@

{
"name": "component-builder",
"version": "0.11.1",
"version": "0.11.2",
"description": "Component build tool",

@@ -11,3 +11,3 @@ "keywords": [

"dependencies": {
"component-require": "1.0.0",
"component-require": "1.0.1",
"batch": "0.2.1",

@@ -14,0 +14,0 @@ "mkdirp": "0.3.4",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc