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

Allow the creation of the root directory based on an ionic.project file ... #270

Closed
wants to merge 1 commit into from
Closed

Allow the creation of the root directory based on an ionic.project file ... #270

wants to merge 1 commit into from

Conversation

lfv89
Copy link

@lfv89 lfv89 commented Feb 26, 2015

Hello.

I've built with gulp an asset pipeline feature that runs through the ionic serve command. This pipeline takes the source files from my-project/www, processes them in many different ways, then outputs the result in the my-project/www/dist dir, which contains the raw js/css that will be served trough ionic serve and wrapped by cordova in an android/ios project.

Here is my problem: since the content of the my-project/www/dist always comes from the same source (www), I don't track it with git, just like no one tracks the my-project/platforms dir. Because of that, after cheking out my project, the ionic serve throws an error and tells me that the www dir is not found. So this PR do the following:

  • fix the ionic serveerror message to output the current dir used as the documentRoot
  • allows the creation of the document root, if it doesn't exist, through a createDocumentRoot option in the ionic.project file

What do you think?

@jbavari jbavari self-assigned this Mar 2, 2015
@jbavari
Copy link

jbavari commented Mar 2, 2015

@vasconcelloslf Let me look over it and get back to you. Thanks for the submission.

@jbavari
Copy link

jbavari commented Mar 5, 2015

@vasconcelloslf - this will be rolling out in 1.3.13. I had to merge it manually. Thanks again for the PR.

@jbavari jbavari closed this in 779cd97 Mar 5, 2015
@lfv89
Copy link
Author

lfv89 commented Mar 7, 2015

Awesome! Tks

@lfv89
Copy link
Author

lfv89 commented Mar 9, 2015

@jbavari

Speaking of build systems. I spent a solid week improving mine, and I would be happy to contribute to ionic in this direction. I basically build the same asset pipeline feature from rails with gulp (with 1 or 2 more things): minification, concatenation, watchers, replace constants (for js), image optimization, etc...

Is ionic interested in having this feature? If it is, I'm wiling to begin the work in a remote branch and follow any guideline or feedback that you guys may provide.

@jbavari
Copy link

jbavari commented Mar 9, 2015

@vasconcelloslf of course. I've tried tackling the minification, but have had troubles trying to please every user in the direction of what tools to use.

Everyone has their own opinion about build systems. However, for those who don't we'd love your help with direction on this.

Do you have a current branch going you'd want me to take a look at?

@lfv89
Copy link
Author

lfv89 commented Mar 23, 2015

@jbavari

Hey, now I do. Check it out the gulpfile https://github.com/vasconcelloslf/ionic-starter-app/blob/master/gulpfile.js

The idea is simple: I have a dev pipeline that runs with ionic start through gulpStartupTasks and a prod pipeline that runs with ionic build xxx through a cordova hook.

I use several gulp plugins to preprocess, minify, concat, injects and replace constants (for more on this last feature check it out https://github.com/vasconcelloslf/ionic-starter-app#8-configure-the-constant-values-gulp).

The dev pipeline doesn't concat nor minifies, but the build pipeline does. I would love to work on it and try to incorporate a build system into ionic, probably as an optional feature.

I want to start a PR to begin to work, but first I would like to hear your feedbacks on the above build system. What do you think?

@jbavari
Copy link

jbavari commented Mar 23, 2015

@vasconcelloslf - Mike and I have taken a quick look at it.

I'll dig more into it today and give some feedback. Thanks again for the work.

@jbavari jbavari mentioned this pull request Mar 23, 2015
@lfv89
Copy link
Author

lfv89 commented Mar 26, 2015

@jbavari Ok, I will be waiting. Let me know if you need anything.

@jbavari
Copy link

jbavari commented Mar 26, 2015

@vasconcelloslf I promise I'm not stalling on you. This is next on my list! I thought I was going to get to it sooner, but I've been getting distracted.

@lfv89
Copy link
Author

lfv89 commented Mar 30, 2015

@jbavari Great! You must have lots of things to do. Just let me know if I can help you in anyway.

@keithdmoore
Copy link

@vasconcelloslf How about using --release to trigger the prod workflow (aka minify, uglify, etc). prod constants would be used when --release is used. Otherwise, dev workflow(aka ionic serve) would only do the constant replacements. What do you think?

@jbavari
Copy link

jbavari commented May 26, 2015

I have a few thoughts - while keeping the mindset that the masses will use this. By no means do I think I have all the answers.

Do you all think gulp is the way to go?

How will we update the gulpfile going forward? (Say between versions of the CLI).

Could we work this into a command instead of leaning on gulp?

How about customization for the users? Can we have it where users customize to their needs instead of the cookie cutter build? Something like utilizing the ionic.project file for customizations which folders to process?

@keithdmoore
Copy link

maybe a --compress option would be better so the user has more flexibility

@EdL
Copy link

EdL commented Jun 3, 2015

Hi @jbavari - I have left a rather lengthy comment on this post #168 summarising my thoughts on the build step. I didn't post it here as I didn't feel it was directly linked to this pull request.

My view on the questions you posted above would be:

Do you all think gulp is the way to go?
Yes

How will we update the gulpfile going forward? (Say between versions of the CLI).

I guess the Gulpfile could just be updated and available via Git as per latest nightly builds. Then when you release CLI version, it is included in there.

Could we work this into a command instead of leaning on gulp?
I think Gulp seems to be the way most people have gone, it's popular, easy to extend or customise etc. It may also be a lot easier to use the Gulp plugins for the various tasks involved in the build. It would be good to have an ionic cli arg to specify whether to do a build at all and whether to do a dev or release build.

e.g. ionic serve -b dev, ionic emulate - b release, ionic build -b release (or shortcut it to just ionic build -b r or whatever)

How about customization for the users? Can we have it where users customize to their needs instead of the cookie cutter build? Something like utilizing the ionic.project file for customizations which folders to process?

Yes. Custom folder for source and destination would be good as well as users being able to add steps to the gulpfile if they wish. At least there will be a common starting point and hopefully it will do what the vast majority needs. Using the ionic.project file seems like a good idea.

Thanks

@okonon
Copy link

okonon commented Jul 24, 2015

@jbavari hello is there any update for this?

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.

5 participants