wrumsby / babel-plugin-resolve-bower-module Goto Github PK
View Code? Open in Web Editor NEWA Babel plugin to resolve ES6 imports that reference Bower modules.
A Babel plugin to resolve ES6 imports that reference Bower modules.
modify dependencies.js#32:47, print more info
var dependencies = (0, _deep.extend)(json.dependencies || {}, json.devDependencies);
console.log('-------------------------dependencies', dependencies, Object.keys(dependencies));
return Promise.all(Object.keys(dependencies).map(function (d) {
return new Promise(function (resolve, reject) {
var file = _path2.default.join(directory, d);
console.log('-------------------------file', file);
(0, _bowerJson.read)(file, function (err, depJson) {
if (err) {
reject(err);
}
console.log('-------------------------depJson', depJson);
resolve((0, _deep.extend)(dependencies, depJson.dependencies || {}, depJson.devDependencies));
});
});
here is log details:
/usr/local/bin/node /Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/gulp/bin/gulp.js --color --gulpfile /Volumes/Doc/sources/js/h5_ztpm_fixed/gulpfile.js scripts:mod-square
[16:50:33] Using gulpfile /Volumes/Doc/sources/js/h5_ztpm_fixed/gulpfile.js
[16:50:33] Starting 'scripts:mod-square'...
-------------------------dependencies { 'angular-animate': '~1.5.5',
'angular-resource': '~1.5.5',
'angular-touch': '~1.5.5',
'animate.css': '~3.4.0',
angular: '~1.5.5',
'angular-utf8-base64': '~0.0.5',
'angular-cookies': '~1.5.5',
fastclick: '~1.0.6',
ngReact: '^0.3.0',
'angular-mocks': '~1.5.5' } [ 'angular-animate',
'angular-resource',
'angular-touch',
'animate.css',
'angular',
'angular-utf8-base64',
'angular-cookies',
'fastclick',
'ngReact',
'angular-mocks' ]
-------------------------file bower_components/angular-animate
-------------------------file bower_components/angular-resource
-------------------------file bower_components/angular-touch
-------------------------file bower_components/animate.css
-------------------------file bower_components/angular
-------------------------file bower_components/angular-utf8-base64
-------------------------file bower_components/angular-cookies
-------------------------file bower_components/fastclick
-------------------------file bower_components/ngReact
-------------------------file bower_components/angular-mocks
-------------------------depJson { name: 'angular-touch',
version: '1.5.5',
license: 'MIT',
main: './angular-touch.js',
ignore: [],
dependencies: { angular: '1.5.5' } }
-------------------------depJson { name: 'angular-resource',
version: '1.5.5',
license: 'MIT',
main: './angular-resource.js',
ignore: [],
dependencies: { angular: '1.5.5' } }
-------------------------depJson { name: 'angular-animate',
version: '1.5.5',
license: 'MIT',
main: './angular-animate.js',
ignore: [],
dependencies: { angular: '1.5.5' } }
-------------------------depJson { name: 'animate.css',
main: './animate.css',
ignore: [ '.', 'src', '.yml', 'Gemfile', 'Gemfile.lock', '*.md' ] }
-------------------------depJson { name: 'angular',
version: '1.5.5',
license: 'MIT',
main: './angular.js',
ignore: [],
dependencies: {} }
-------------------------depJson { name: 'angular-cookies',
version: '1.5.5',
license: 'MIT',
main: './angular-cookies.js',
ignore: [],
dependencies: { angular: '1.5.5' } }
-------------------------depJson undefined
-------------------------depJson undefined
[16:50:39] Time: 5320ms
ERROR in ./src/app/square/index.module.js
/Volumes/Doc/sources/js/h5_ztpm_fixed/src/app/square/index.module.js
7:10 error "run" is defined but never used no-unused-vars
โ 1 problem (1 error, 0 warnings)
ERROR in ./src/app/square/index.module.js
Module build failed: TypeError: Cannot read property 'dependencies' of undefined
at /Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-plugin-resolve-bower-module/lib/dependencies.js:45:58
at /Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/bower-json/lib/json.js:46:24
at FSReqWrap.readFileAfterClose as oncomplete
at Function.module.exports.loopWhile (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/deasync/index.js:72:22)
at /Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/deasync/index.js:44:19
at Plugin.manipulateOptions (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-plugin-resolve-bower-module/lib/index.js:12:17)
at File.buildPluginsForOptions (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-core/lib/transformation/file/index.js:251:16)
at new File (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-core/lib/transformation/file/index.js:137:10)
at Pipeline.transform (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
at transpile (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-loader/index.js:14:22)
at Object.module.exports (/Volumes/Doc/sources/js/h5_ztpm_fixed/node_modules/babel-loader/index.js:88:12)
[16:50:39] Finished 'scripts:mod-square' after 5.37 s
Process finished with exit code 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.