wain-pc / gulp-flow-remove-types Goto Github PK
View Code? Open in Web Editor NEWGulp plugin for flow-remove-types
Gulp plugin for flow-remove-types
When gulp building errors the message printed is not very helpful. As you can see in the following error, the line of code and the domain are not printed, giving no clue about where the error is
[08:55:40] Starting 'build'...
[08:55:40] 'build' errored after 400 ms
[08:55:40] SyntaxError in plugin 'gulp-flow-remove-types'
Message:
await is a reserved word (183:12)
Details:
pos: 3492
loc: [object Object]
domain: [object Object]
domainThrown: true
error Command failed with exit code 1.
This is my gulp configuration:
const gulp = require('gulp');
const flowRemoveTypes = require('gulp-flow-remove-types');
gulp.task('build', function () {
return gulp.src('./src/**/*.js')
.pipe(flowRemoveTypes({pretty: true}))
.pipe(gulp.dest('./dist/'));
});
I'm using gulp4 btw.
we are currently flow into our project and although removing flow types doesn't necessarily generate radically different files, the sourcemaps option would be a nice touch if it worked for us.
our current transpiling task on gulp is as follows:
gulp.task('transpile', ['clean-transpiled', 'scripts'], transpileScripts);
function transpileScripts () {
return gulp.src([
path.join(conf.paths.src, '/app/**/*.js'),
`!${path.join(conf.paths.src, '/app/constant.url.js')}`
])
.pipe(removeFlowTypes({
pretty: true,
sourceMap: true
}))
.pipe(debug())
.pipe(gulp.dest(path.join(conf.paths.src, '/.transpiled')));
}
The file index.utilities.factory
which is included and stripped of its types, isn't getting its respective map generated, since gulp-debug doesn't report the map file.
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.