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

gulp: generate non-minified files for debug and use gulp tasks #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

roipoussiere
Copy link

@roipoussiere roipoussiere commented Mar 5, 2019

This PR builds Javascript and CSS files without minifying them, useful for debugging purposes. The dist folder hierarchy is now:

dist
├── easymde.css
├── easymde.js
├── easymde.min.css
└── easymde.min.js

No more unpractical Javascript errors like "error line 7, column 291438".

It also uses gulp tasks instead of functions.

In this way we can call a specific gulp task, among gulp lint, gulp build-js, gulp build-css, gulp minify-js, gulp minify-css, gulp build, gulp minify, gulp.

edit: sorry for merge commit, you can squash it with the first one when merging to master.

@Ionaru
Copy link
Owner

Ionaru commented Mar 6, 2019

Couple of issues I have with this:

Because these files are now created when gulp is ran, they are now packaged and sent to npm as well.
I don't think we should publish debug builds to npm.
The same could be achieved with sourcemaps.


You're using an old way of creating tasks in gulp and this is discouraged by gulp itself. Since gulp 4.0.0 a task should be defined like this:

function build() { ... }
exports.build = build;

Or in typescript:

export function build() { ... }

https://gulpjs.com/docs/en/getting-started/creating-tasks

@axe312ger
Copy link

axe312ger commented Apr 9, 2019

Instead of seeing it as debug build, why not exporting them as es6 modules without minification. People using bundlers like webpack would benefit from this and debugging will be way easier :)

@A-312
Copy link

A-312 commented Jan 26, 2020

Couple of issues I have with this:

Because these files are now created when gulp is ran, they are now packaged and sent to npm as well.
I don't think we should publish debug builds to npm.

We can ignore this file when we do npm publish with files settings in package.json: https://docs.npmjs.com/files/package.json#files

The same could be achieved with sourcemaps.

+1 sourcemaps is a more practical alternative.

@roipoussiere
Copy link
Author

Hello, what is a status of this PR? Should I modify something or just drop the idea?

@A-312
Copy link

A-312 commented May 6, 2020

@roipoussiere gulp.task is the old solution

image

https://www.sitepoint.com/how-to-migrate-to-gulp-4/

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.

4 participants