Answer the question
In order to leave comments, you need to log in
How to speed up jsx to javascript conversion through gulp?
there is a Galpov task:
gulp.task("buildJSX", function () {
return browserify({ entries: "./client/jsx/app.jsx", extensions: [".jsx"], debug: false })
.transform("babelify", { presets: ["es2015", "react"] })
.bundle()
.pipe(source("bundle.js"))
.pipe(gulp.dest("./server/gulpTemplate/js"));
});
Finished 'buildJSX' after 4.11 s
let gulp = require("gulp"),
browserify = require("browserify"),
babelify = require("babelify"),
source = require("vinyl-source-stream");
Answer the question
In order to leave comments, you need to log in
In this form, it will always be slow, because everything is compiled from scratch. Use watchify ( for example ) - it watches for changes and caches compiled files.
Well, if the goal is to “learn react” or “quickly make an application in react”, and not “fuck with gallp and browser-fay”, then don’t suffer and take create-react-app .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question