我应该将JS存储在Laravel 5中的什么位置? [英] Where should I store JS in Laravel 5?
问题描述
我可以在2个地方存储JavaScript:resources/assets/javascripts
和public/js
.
There are 2 places where I can store javascripts: resources/assets/javascripts
and public/js
.
如果将文件放在resources/assets/javascripts
中,则应添加gulp任务以将其复制.这是此方法的缺点.而且我们将需要在浏览器调试器中进行路径映射.
If we put the files in resources/assets/javascripts
, we should add gulp tasks to copy them. And this is a weakness of this method. And we will need path mapping in browser debugger.
如果将这些文件放在public/js
中,则会将源JS和已编译JS放在一个位置,并且它们会被弄乱.
If we put these files in public/js
, we will have our source JS and compiled JS in one place and they will be messed up.
那么,我应该将JS存储在Laravel 5中的什么地方?
So, where should I store JS in Laravel 5?
推荐答案
发现了我的旧问题,并决定回答自己.
Found my old question and decided to answer myself.
在2018年,最好将系统拆分为多个单独的项目:后端,前端,iOS应用程序,Android应用程序等.
每个应用程序可能都有自己的构建系统,目录结构等.
In 2018 it's better to split the system into many separate projects: backend, frontend, iOS app, Android app, etc.
And each app may have its own build system, directory structure, etc.
这篇关于我应该将JS存储在Laravel 5中的什么位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!