Skip to content
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

Refactor guplfile.js #32

Merged
merged 1 commit into from
Jun 7, 2022
Merged

Conversation

Raruto
Copy link
Collaborator

@Raruto Raruto commented Jun 7, 2022

First rewrite of the gulpfile to try to make it easier for anyone to understand:

  • move declare statements to top
  • avoid some negative conditionals
  • comment out dead code
  • use multiline comments for tasks
  • inline some unnecessary functions definitions

Related to: #29

- move declare statements to top
- avoid some negative conditionals
- comment out dead code
- use multiline comments for tasks
- inline some unnecessary functions definitions
@volterra79 volterra79 merged commit 9818eaf into g3w-suite:dev Jun 7, 2022
@volterra79
Copy link
Member

@Raruto done. I checked and i need to push a commit to fix an issue on gulpfile regarding 'browser-sync' task on line 322:
const port = conf.localServerPort ?? 3000; to const port = conf.localServerPort || 3000;

@Raruto
Copy link
Collaborator Author

Raruto commented Jun 7, 2022

@volterra79

ok, but keep in mind that the following statement:

const port = conf.localServerPort ?? 3000;

is equivalent to the following (which was the starting code):

const port = conf.localServerPort ? conf.localServerPort : 3000;

and not to:

const port = conf.localServerPort || 3000;

or at least I think so

@volterra79
Copy link
Member

@Raruto you are right. If run npm run default using

const port = conf.localServerPort ?? 3000; 

i receive an error

`const port = conf.localServerPort ?? 3000;
^

SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
`

@Raruto
Copy link
Collaborator Author

Raruto commented Jun 7, 2022

yes, there is probably a project dependency with does not yet support the nullish coalescing operator.

@volterra79
Copy link
Member

@Raruto i investigate on it

@Raruto Raruto deleted the gulpfile-refactor branch June 8, 2022 07:26
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.

None yet

2 participants