CodeSleeve / asset-pipeline

This Laravel 4 package provides a very simple and easy to use asset pipeline. It was heavily inspired by the Rails asset pipeline. We make use of the wonderful Assetic package to help with pre-compliation!
http://www.codesleeve.com
MIT License
489 stars 53 forks source link

how to include files from public folder? #63

Closed varmad closed 10 years ago

varmad commented 10 years ago

Hi

I have some files in public folder. How I can include?

and how I can include a specific file from public/assets/js folder?

evantishuk commented 10 years ago

Is there a reason those files can be in /app/assets?

deftnot commented 10 years ago

Just publish the config file for assets pipeline and add the route there

Jesús Solis

El 22/11/2013, a las 04:42 a.m., Srinivasa varma notifications@github.com escribió:

Hi

I have some files in public folder. How I can include?

— Reply to this email directly or view it on GitHub.

varmad commented 10 years ago

@evantishuk there is no specific reason, suppose if I want to use then it should be accessed from any folder

varmad commented 10 years ago

I configured as follows

My actual css file is in public/assets/vendors/demo/demo.css

In app/config/packages/codesleeve/asset-pipeline/config.php added below line

'paths' => { ..........

'public/assets/vendors' => 'javascripts,stylesheets', ..... }

and then in app/assets/application.css added below line of code

*= require demo/demo

after doing this the demo.css file was included but the styles are not applying

can any one please suggest on this

Thanks

kdocki commented 10 years ago

@varmad there is nothing wrong with including your public folder in your paths but I would be weary of doing public/assets/ ... because that is your prefix.

So if you go to http://localhost:8000/assets/vendors/foo.js (will this hit the asset pipeline or just the regular file?) That all depends on how you have your mod_rewrite filters and for apache or nginx differ ... ultimately this could cause you (and your sysadmin) a lot of headaches.

What happens if you use public/someotherfolder instead?

kdocki commented 10 years ago

Publish config

php artisan config:publish codesleeve/asset-pipeline

inside of app/config/packages/codesleeve/asset-pipeline/config.php add to paths

    'paths' => array(
        'app/assets/javascripts',
        'app/assets/stylesheets',
        'lib/assets/javascripts',
        'lib/assets/stylesheets',
        'provider/assets/javascripts',
        'provider/assets/stylesheets',
                'public/assets/vendors'
    ),