Socket
Socket
Sign inDemoInstall

aliasify

Package Overview
Dependencies
4
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.1 to 1.6.0

test/mocha.opts

4

CHANGELOG.md

@@ -0,1 +1,5 @@

* 1.6.0
* Add support for passing configuration directly via browserify (added in Browserify v3.41.0?)
* Verbose messages now log to stderr (courtesy [Zaim Bakar](https://github.com/zaim))
* 1.5.0 - Use 'fromSourceFileDir' from browserify-transform-tools to correctly resolves package.json (courtesy of [Justin Howard](https://github.com/justinhoward))
* 1.4.0 - Add support for `relative:` aliases. (courtesy of [mkuklis](https://github.com/mkuklis).)

@@ -2,0 +6,0 @@ * 1.3.1 - Use browserify-transform-tools to decide which files are JS or not.

8

lib/aliasify.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.3
// Generated by CoffeeScript 1.9.1
(function() {

@@ -27,3 +27,3 @@ var getReplacement, path, transformTools;

}, function(args, opts, done) {
var aliases, configDir, file, fileDir, replacement, result, verbose, _ref;
var aliases, configDir, file, fileDir, ref, replacement, result, verbose;
if (!opts.config) {

@@ -34,3 +34,3 @@ return done(new Error("Could not find configuration for aliasify"));

verbose = opts.config.verbose;
configDir = ((_ref = opts.configData) != null ? _ref.configDir : void 0) || opts.config.configDir || process.cwd();
configDir = ((ref = opts.configData) != null ? ref.configDir : void 0) || opts.config.configDir || process.cwd();
result = null;

@@ -49,3 +49,3 @@ file = args[0];

if (verbose) {
console.log("aliasify - " + opts.file + ": replacing " + args[0] + " with " + replacement);
console.error("aliasify - " + opts.file + ": replacing " + args[0] + " with " + replacement);
}

@@ -52,0 +52,0 @@ result = "require('" + (replacement.replace(/\\/gi, "/")) + "')";

{
"name": "aliasify",
"version": "1.5.1",
"version": "1.6.0",
"description": "Rewrite require calls in browserify modules.",

@@ -23,7 +23,7 @@ "main": "./lib/aliasify.js",

"dependencies": {
"browserify-transform-tools": "~1.2.2"
"browserify-transform-tools": "~1.3.1"
},
"devDependencies": {
"coffee-script": "1.6.3",
"mocha": "1.15.0"
"coffee-script": "^1.8.0",
"mocha": "^2.1.0"
},

@@ -30,0 +30,0 @@ "scripts": {

@@ -15,4 +15,4 @@ Aliasify is a [transform](https://github.com/substack/node-browserify#btransformtr) for [browserify](https://github.com/substack/node-browserify) which lets you rewrite calls to `require`.

"aliasify": {
aliases: {
"d3": "./shims/d3.js"
"aliases": {
"d3": "./shims/d3.js",
"underscore": "lodash"

@@ -59,14 +59,14 @@ }

aliasify = require('aliasify').configure({
aliasifyConfig = {
aliases: {
"d3": "./shims/d3.js"
},
configDir: __dirname,
verbose: false
});
}
var b = browserify();
b.transform(aliasify);
b.transform(aliasify, aliasifyConfig);
note that `configure()` returns a new `aliasify` instance.
note that using the browserify API, './shims/d3.js' will be resolved against the current working
directory.

@@ -88,5 +88,6 @@ Configuration options:

The "./" means this will be resolved relative to the configuration file which contains the line.
Sometimes it is desirable to literally replace an alias; to resolve the alias relative to the
file which is doing the `require` call. In this case you can do:
The "./" means this will be resolved relative to the current working directory (or relative to the
configuration file which contains the line, in the case where configuration is loaded from
package.json.) Sometimes it is desirable to literally replace an alias; to resolve the alias
relative to the file which is doing the `require` call. In this case you can do:

@@ -93,0 +94,0 @@ aliases: {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc