javascript - ES6 modules + Gulp -
I need to create a bundle, an app example written with the es6 module:
Import APIs from APIs; Function loader () {// some code which user API}; Export default loader; Develop a version that converts AMD into GUD-AS 6-Module-Transpolar and needs to work well with those. But I can not find a way to make bundles with this: I am trying to make the GLUP-AS 6-module-tripler and gull-browser:
gulp.task ('build_js', function (gulp.src ('app / ** / * .jsx') .pipe (gulp_react ({errLogToConsole: true})) .pipe (transcriber ({type: 'cjs'}) .pipe (gulp.dest ( '.' '+ Build_fld +' / '));}); Gulp.task ('brow', ['build_js'] function () {gulp.src ('dist / auto-name.js') .pip (browserfile ()) .Pipe (gulp.dest ('./' + Build_fld + '/'));}); But there is an error in my browser:
Error: module 'name' did not match 'd: \\ function \\ lib.react-suggest \\ districts \\ fake_32525252.js'; But generally it is incorrect because, as I have not supported the browser, vinyl streams understand, and to make JN files with the usual JS module first Required, and then User Browserfai
Maybe I think something wrong, and it can be made from a stream? Is the other solution possible? As a result, I want to produce for AMD and CommonJS or Global for development.
The App File Structure that I have:
/ app -app.jsx -component1.jsx -component2 .jsx -index.html /.tmp / dist gulpfile js As a result I want to:
/ app -app.jsx -component1.jsx -component2.jsx -index.html /.tmp-app .js-component1.js-component2.js-index.html / dist -app.min.js gulpfile.js
I accept the stream in the browser-add / need method, which I know. I'm not sure Gull calls produces the correct stream. However, why can you explicitly use GLUP, when you can call the browser API directly to produce the result?
var b = browserify (); B.add ('district / auto name.js'); B. Bundle () Pipe (gulp.dest ('.' '+ Build_field +' / ')); Unless you are doing some magic with fiction, you have not shown here. Good luck in that situation :)
Comments
Post a Comment