2016-01-23 40 views
2

我試圖找出如何告訴babel6生成特定模塊的語法(AMD,CommonJS的,等等)babel5 - > babel6:模塊屬性

這是我用來指定模塊:https://github.com/aurelia/metadata/blob/master/build/tasks/build.js#L48


gulp.task('build-commonjs', function() { 
    return gulp.src(paths.output + jsName) 
    .pipe(to5(assign({}, compilerOptions, {modules:'common'}))) 
    .pipe(gulp.dest(paths.output + 'commonjs')); 
}); 

gulp.task('build-amd', function() { 
    return gulp.src(paths.output + jsName) 
    .pipe(to5(assign({}, compilerOptions, {modules:'amd'}))) 
    .pipe(gulp.dest(paths.output + 'amd')); 
}); 

babel6給我的錯誤:Unknow option: base.modules

明白任何指導! :)


錯誤:

events.js:141 
     throw er; // Unhandled 'error' event 
    ^
ReferenceError: [BABEL] C:\a\au\metadata\dist\aurelia-metadata.js: Unknown option: base.modules 
    at Logger.error (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\file\logger.js:41:11) 
    at OptionManager.mergeOptions (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\file\options\option-manager.js:262:18) 
    at OptionManager.init (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\file\options\option-manager.js:416:10) 
    at File.initOptions (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\file\index.js:191:75) 
    at new File (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\file\index.js:122:22) 
    at Pipeline.transform (C:\a\au\metadata\node_modules\gulp-babel\node_modules\babel-core\lib\transformation\pipeline.js:42:16) 
    at DestroyableTransform._transform (C:\a\au\metadata\node_modules\gulp-babel\index.js:32:20) 
    at DestroyableTransform.Transform._read (C:\a\au\metadata\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:172:10) 
    at DestroyableTransform.Transform._write (C:\a\au\metadata\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:160:12) 
    at doWrite (C:\a\au\metadata\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:335:12) 
    at writeOrBuffer (C:\a\au\metadata\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:321:5) 
    at DestroyableTransform.Writable.write (C:\a\au\metadata\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:248:11) 
    at write (C:\a\au\metadata\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:623:24) 
    at flow (C:\a\au\metadata\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:632:7) 
    at DestroyableTransform.pipeOnReadable (C:\a\au\metadata\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:664:5) 
    at emitNone (events.js:67:13) 
+0

如果您正在開發使用aurelia框架。使用非常兼容的打字稿 –

+0

hi @Venkatraman - 我正致力於將aurelia構建過程升級爲使用babel5中的babel6。這就是aurelia .d.ts文件如何從ES7源代碼生成的。我與你100%在TypeScript :) :) –

+0

更新問題中的babeljs的確切和完整的錯誤進一步進行 –

回答

相關問題