-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gulp: Refactoring #1780
gulp: Refactoring #1780
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, r+
gulpfile.js
Outdated
function build(cb) { | ||
pump([src(paths.main), header('\n/* **********************************************\n' + | ||
' Begin <%= file.relative %>\n' + | ||
'********************************************** */\n\n'), concat('prism.js'), dest('./')], cb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're ES6-ifying everything, we can make this a template string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'********************************************** */\n\n'), concat('prism.js'), dest('./')], cb); | |
********************************************** */ | |
`), concat('prism.js'), dest('./')], cb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do this because then the line ends of prism.js
depend on the line ends of gulpfile.js
.
But if you think that that's not a problem I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm. Template strings ftw! I already use them anyway for components.js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit then gtg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply these in a single commit using the files tab:
gulpfile.js
Outdated
pump([src(paths.plugins), ...minifyJS(), rename({ suffix: '.min' }), dest('plugins')], cb); | ||
} | ||
function build(cb) { | ||
pump([src(paths.main), header('\n/* **********************************************\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pump([src(paths.main), header('\n/* **********************************************\n' + | |
pump([src(paths.main), header(` | |
/* ********************************************** |
gulpfile.js
Outdated
} | ||
function build(cb) { | ||
pump([src(paths.main), header('\n/* **********************************************\n' + | ||
' Begin <%= file.relative %>\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
' Begin <%= file.relative %>\n' + | |
Begin <%= file.relative %> |
gulpfile.js
Outdated
function build(cb) { | ||
pump([src(paths.main), header('\n/* **********************************************\n' + | ||
' Begin <%= file.relative %>\n' + | ||
'********************************************** */\n\n'), concat('prism.js'), dest('./')], cb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'********************************************** */\n\n'), concat('prism.js'), dest('./')], cb); | |
********************************************** */ | |
`), concat('prism.js'), dest('./')], cb); |
Since we just switched to gulp v4 (#1779) and dropped support for Node 4 some time ago, I took the chance to refactor our
gulpfile.js
.I used ES6 syntax and removed
gulp.task
which is not recommended anymore.(Let's see if Node v6 can handle the changes. Edit: It worked.)