Skip to content

Conversation

@teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented May 14, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no?
Deprecations? no
Related tickets N/A
License MIT

Upgrade to gulp 4

Use gulpfile.babel.js so that we can write in ES2015+ 🎉

/cc @pamil

argv.rootPath || '../../../../web/assets/',
...(argv.vendorPath ? [
'--vendorPath',
argv.vendorPath + 'sylius/sylius/src/Sylius/Bundle/',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this to allow using a custom vendorPath from the parent gulpfile. WDYT @pamil?

@@ -1,11 +1,16 @@
{
"dependencies": {
"babel-runtime": "^6.26.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is under dependencies instead of devDependencies to prepare for the future where we will use Babel for all Sylius JS files. 😆

.pipe(gulpif(env !== 'prod', sourcemaps.mapSources(mapSourcePath)))
.pipe(gulpif(env !== 'prod', sourcemaps.write('./')))
.pipe(gulp.dest(adminRootPath + 'js/'))
.pipe(livereload())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the livereload() call here because it seemed to be missing. Let me know if it was intentionally omitted.

.pipe(gulpif(env !== 'prod', sourcemaps.write('./')))
.pipe(gulp.dest(adminRootPath + 'css/'))
.pipe(livereload())
,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this comma too... But I'm not sure where else to put it. 🙈

export const build = gulp.parallel(buildAdmin, buildShop);
build.description = 'Build assets.';

gulp.task('admin', buildAdmin);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should keep these aliases?

@pamil pamil self-requested a review May 15, 2018 19:29
.pipe(gulpif(env !== 'prod', sourcemaps.mapSources(mapSourcePath)))
.pipe(gulpif(env !== 'prod', sourcemaps.write('./')))
.pipe(gulp.dest(upath.joinSafe(adminRootPath, 'js')))
.pipe(livereload());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the livereload() call here because it seemed to be missing. Let me know if it was intentionally omitted.

.pipe(gulpif(env !== 'prod', sourcemaps.mapSources(mapSourcePath)))
.pipe(gulpif(env !== 'prod', sourcemaps.write('./')))
.pipe(gulp.dest(upath.joinSafe(shopRootPath, 'js')))
.pipe(livereload());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the livereload() call here because it seemed to be missing. Let me know if it was intentionally omitted.

@teohhanhui
Copy link
Contributor Author

ping @pamil

.babelrc Outdated
"presets": [
["env", {
"targets": {
"node": "4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could increment this to 6, since we don't support unmaintained Node.js versions.

Use gulpfile.babel.js so that we can write in ES2015+
"scripts": {
"gulp": "gulp"
"build": "gulp",
"gulp": "gulp",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept for BC.

@pamil pamil merged commit 2301a0d into Sylius:master May 21, 2018
@pamil
Copy link
Contributor

pamil commented May 21, 2018

Thank you, Teoh, looks awesome! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants