Answer the question
In order to leave comments, you need to log in
Why didn't the html page output when building the gulp package?
source/app.js folder
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>
Hello <b>React</b>!
</h1>,
document.getElementById("app")
)
gulp.task('babelJSX', function() { // для транспиляции jsx
return gulp.src('js/source/**/*.js')
.pipe(babel({
plugins: ['transform-react-jsx']
}))
.pipe(gulp.dest('js/build'))
});
gulp.task('babel', function() { // для es2015
return gulp.src('js/build/**/*.js')
.pipe(babel({ presets: ["@babel/preset-env", "@babel/preset-react"] }))
.pipe(gulp.dest('js/build'))
});
gulp.task('browserify', function() { // создание одного пакета bundel.js
return gulp.src('js/build/**/*.js')
.pipe(browserify({
transform: ['es6ify'],
extensions: ['.js']
}))
.pipe(rename('bundle.js'))
.pipe(gulp.dest('./'))
});
gulp.task('concat', function() { // bundle.css
return gulp.src('css/**/*.css')
.pipe(concat('bundle.css'))
.pipe(gulp.dest('./'));
});
Hello
or getElementById('app'). Tell me what is the error, maybe use some analogue of browserify?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question