简体   繁体   English

我应该使用资产文件夹还是公用文件夹? laravel 5.3

[英]should I use assets folder or public folder? laravel 5.3

Using Laravel 5.3 使用Laravel 5.3

I realized now the view files are under a folder called resources and there's an assets folder which has js folder in it. 我意识到现在视图文件位于一个名为resources的文件夹下,并且有一个assets文件夹,其中包含js文件夹。 public folder still exists public文件夹仍然存在

I have read a few other posts saying it's up to you either I want to put my js or css under public or assets 我读过其他几篇文章说,由我决定将我的jscss置于publicassets之下

I also know that when using gulp files are directed under public which is changeable. 我也知道,在使用gulp文件时,这些文件是在可更改的public下定向的。

I am wondering if I put my files under the assets then compile under public do I have to run the compile each time when I test my scripts? 我想知道是否将文件放在assets然后在public下编译吗?每次测试脚本时都必须运行编译吗? If not, what should I put as the src in my html? 如果没有,我应该把什么作为src放在我的html中?

You should put it in your public folder. 您应该将其放在公用文件夹中。 If you use URL::asset('path/to/file') it will return [...]app/public/path/to/file and not the resources path as well. 如果您使用URL::asset('path/to/file') ,它将返回app / public / path / to / file,而不是资源路径。

The resources folder you mentioned is more for raw assets like SASS, LESS, etc. 您提到的资源文件夹更多地用于原始资产,例如SASS,LESS等。

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

相关问题 应该在 src 文件夹或公用文件夹中添加和使用图像吗? - Should add and use image inside src folder or public folder? 公用文件夹中的Laravel图片 - Laravel Images in Public Folder 使用 webpack 将资产文件夹推送到公共目录 - push assets folder to public directory with webpack 在laravel 5.3的Folder中上传文件时出现问题? - Problem in uploading file in Folder in laravel 5.3? 链接到Meteor.js和Telescope中公用文件夹中的资源 - Linking to assets in the public folder in Meteor.js and Telescope CSS 和公用文件夹中的其他资产未包含在构建中 - CSS and other assets from the public folder not getting included in the build 我如何拥有一个可以在我的 React 应用程序中的任何文件中使用的资产文件,而不必总是导航到资产文件夹 - How do i have an assets file that i can use in any file in my react app without always having to navigate to the assets folder 在 VueJS 中存储图像的正确位置是什么 - 公共文件夹或资产文件夹? - What's the proper location to store images in VueJS - public folder or assets folder? 在公共文件夹中使用 SVGR 和 svg - React use SVGR with svg in public folder 无法使用公用文件夹中的流星图像 - Can't use Meteor images that are in the folder public
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM