简体   繁体   English

更新Laravel中的public / assets vs.resources / assets文件夹,使用Bower / Gulp管理资产

[英]Updating public/assets vs. resources/assets folder in Laravel, managing assets with Bower / Gulp

I am just starting to learn Laravel and have some questions about the directory structure, updating with composer, gulp, bower, the "public" folder, "resources", etc. Sorry, I am a newbie. 我刚刚开始学习Laravel,并对目录结构有一些疑问,正在使用composer,gulp,bower,“ public”文件夹,“ resources”等进行更新。对不起,我是新手。

I got a Laravel Admin template online, so the setup there may be different than the raw install, but it seems basically the same: 我在线上有一个Laravel Admin模板,因此那里的设置可能与原始安装有所不同,但看起来基本相同:

app
bootstrap
config
database
public
resources
storage
tests
vendor

My question regards the assets folder under public and the assets folder under resources. 我的问题是关于public下的资产文件夹和resource下的资产文件夹。 The template that I have uses gulp and bower, so my question is if I change some css or javascript for one of my files, should I do that in the /resources/assets path or the /public/assets path ? 我拥有的模板使用gulp和bower,所以我的问题是,如果我为其中一个文件更改了一些CSS或javascript,我应该在/ resources / assets路径还是/ public / assets路径中执行此操作? Seems like you should update the resources and then do update with bower and gulp, otherwise your changes could get overwritten. 似乎您应该更新资源,然后使用bower和gulp进行更新,否则您的更改可能会被覆盖。 Does that apply to everything in the /resources/assets path ? 这是否适用于/ resources / assets路径中的所有内容? Update there and then update your /public/assets path ? 在此处更新,然后更新您的/ public / assets路径?

It does seem a little strange that the resources folder is essentially your development assets that can be compiled, but the views are in the resources folder, not the public folder. 资源文件夹本质上是可以编译的开发资产,这似乎有些奇怪,但是视图位于资源文件夹中,而不是公共文件夹中。 Is that because they are xxx.blade files.php files, development files and are sort of compiled into xxx.php virtual files in the public directory at runtime ? 那是因为它们是xxx.blade files.php文件,开发文件,并且在运行时被整理成公共目录中的xxx.php虚拟文件吗?

You use Gulp and Bower to compile your custom assets in a more efficient way. 您可以使用Gulp和Bower来更有效地编译自定义资产。 If the template you downloaded makes use of these tools then you need to make your changes in the source files you feed Gulp/Bower and they take care of the rest and place the results in /resources/assets. 如果您下载的模板使用了这些工具,那么您需要在提供给Gulp / Bower的源文件中进行更改,它们将处理其余工作并将结果放在/ resources / assets中。

The /public/assets folder is where you or the template you downloaded save assets won't be edited by Gulp/Bower and can be accessible from the root path of your project. / public / assets文件夹是您或下载的保存资产模板不会在Gulp / Bower中进行编辑的文件夹,可以从项目的根路径进行访问。 What ever you edit here will be kept like that until you make any manual modification again. 您在此处所做的编辑将保持不变,直到您再次进行任何手动修改为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM