babel-plugin-universal-import
Advanced tools
Comparing version 3.0.2 to 3.0.3
13
index.js
@@ -5,2 +5,4 @@ 'use-strict' | ||
const path = require('path') | ||
const visited = Symbol('visited') | ||
@@ -113,3 +115,5 @@ | ||
t.identifier('file'), | ||
t.stringLiteral(p.hub.file.opts.filename) | ||
t.stringLiteral( | ||
path.relative(__dirname, p.hub.file.opts.filename || '') || '' | ||
) | ||
) | ||
@@ -210,6 +214,6 @@ } | ||
const opts = this.opts.babelServer | ||
const opts = (this.opts.babelServer | ||
? [ | ||
idOption(t, importArgNode), | ||
fileOption(t, p), | ||
this.opts.includeFileName ? fileOption(t, p) : undefined, | ||
pathOption(t, pathTemplate, p, importArgNode), | ||
@@ -221,3 +225,3 @@ resolveOption(t, resolveTemplate, importArgNode), | ||
idOption(t, importArgNode), | ||
fileOption(t, p), | ||
this.opts.includeFileName ? fileOption(t, p) : undefined, | ||
loadOption(t, loadTemplate, p, importArgNode), // only when not on a babel-server | ||
@@ -228,2 +232,3 @@ pathOption(t, pathTemplate, p, importArgNode), | ||
] | ||
).filter(Boolean) | ||
@@ -230,0 +235,0 @@ const options = t.objectExpression(opts) |
{ | ||
"name": "babel-plugin-universal-import", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Babel plugin to transform import() into its Universal counterpart", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -149,2 +149,16 @@ <a href="https://gitter.im/Reactlandia/Lobby" target="_blank"> | ||
## Include additional debugging info | ||
To prevent leaking of information, file names are not included in the final output. However, for debugging purposes, you may set the `includeFileName` flag option to true. This will include the path to the source file from which the import() is happening to be exposed. | ||
```js | ||
{ | ||
"plugins": [ | ||
["universal-import", { | ||
"includeFileName": true | ||
}] | ||
] | ||
} | ||
``` | ||
## Next Steps | ||
@@ -151,0 +165,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231
191
362872