Package Exports
- babel-file-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-file-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
babel-file-loader
Load files into memory to be parsed & traversed using Babylon/Babel
import {loadImportSync} from 'babel-file-loader';
export function plugin() {
return {
visitor: {
ImportDefaultDeclaration(path) {
let file = loadImportSync(path);
file.path.traverse({
ExportDefaultDeclaration() {
console.log('Found matching export default');
},
});
},
},
},
};
API
resolveFilePath{Async,Sync}(path, filePath, resolveOpts)
Resolve a filePath
relative to the file a path
belongs to. Returns string.
resolveImportFilePath{Async,Sync}(path, resolveOpts)
Resolve an import declaration path
to extract a file path. Returns string.
loadFile{Async,Sync}(filePath, parserOpts)
Load and parse a file from a filePath
. Returns File.
loadImport{Async,Sync}(path, resolveOpts, parserOpts)
Load and parse a file from an import declaration path
. Returns File.