在Laravel 9中,我在哪里包括自定义JS和CSS文件?
我正在手动下载这些CS和JS文件: https://github.com/1j01/os------ gui
我不确定我的Laravel 9应用程序中应该放置CSS和JS文件。
做什么的正确方法是什么?我应该只下载文件并将文件放在public
目录中吗?但是,我不应该利用Laravel 9的混音来编译JS CSS文件,如果是这样,我该怎么做?
这是我要使用的文件列表:
css/layout.css
css/windows-98.css
css/windows-default.css
js/$Window.js
js/MenuBar.js
js/parse-theme.js
js/demo.js
js/jquery-3.3.1.js // i'll probably use v3.6.0 (or whatever is the latest version)
I'm manually downloading these CSS and JS files from: https://github.com/1j01/os-gui
I'm not sure where in my Laravel 9 app I should place the CSS and JS files.
What's the proper way to do it? Should I just download and place the files in the public
directory? But shouldn't I be utilizing Laravel 9's Mix to compile the JS CSS files, and if so how can I go about doing that?
This is the list of files I want to use:
css/layout.css
css/windows-98.css
css/windows-default.css
js/$Window.js
js/MenuBar.js
js/parse-theme.js
js/demo.js
js/jquery-3.3.1.js // i'll probably use v3.6.0 (or whatever is the latest version)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望这些文件得到优化和控制,并且也希望每个请求都不下载一堆CSS和JS文件,则应使用默认安装的Laravel Mix,
您应该将这些文件放入 /Resources文件夹中并将其编译为一个文件,忠实地,您可以使用混合purge插件将被清除/优化。
这在您的webpack.mix.js中真的很简单
If you want those files to be optimized and controlled and also want that every request does not download a bunch of css and js files, you should use laravel mix which is installed by default
You should put those files inside /resources folder and compile them into a single file, adittionally you could purge with the mix purge plugin so your assets will be purged/optimized.
This is really simple in your webpack.mix.js