如何将Semantic-UI添加到Phoenix [英] How to add Semantic-UI to Phoenix

查看:111
本文介绍了如何将Semantic-UI添加到Phoenix的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Semantic-UI添加到Phoenix?



Semantic-UI安装在文件夹中并使用NPM更新,并且构建了实际的CSS和Javascript文件使用GULP。完整安装文件夹应该放在哪里?



可以像其他依赖项一样通过Mix自动更新吗?



是否应将生成的CSS和javascript放在project / web / static / css(或/ js)或/ vendor中?



如何设置Gulp / Sematic -UI配置自动将文件放置在正确的位置?



再次,Mix可以自动运行Gulp / Semantic-UI构建吗?

解决方案

完整安装文件夹应该放在哪里?



实际上,您只需要 2个文件:semantic.js&语义.css。
如果您做了 npm安装--save语义-ui ,则应该在中找到它们。/semantic/dist/



那么,这两个文件应该放在哪里?
这取决于...您是早午餐吗 webpack ?与phoenix应用程序相关的是在./priv/static文件夹中找到静态文件(css,js,字体,img,...),正如您在 endpoint.ex 中看到的那样即插即用。 Phoenix不知道在运行早午餐,webpack或/和gulp之前将这些文件放置在哪个目录。



可以通过Mix自动更新... p>

,在 package.json 中添加脚本,在 config / dev.exs



应该将生成的CSS和javascript放在project / web / static / css(或/ js)还是/ vendor中?



相同的答案,您是早午餐还是Webpack?
与phoenix应用程序相关的是,您可以在 ./ priv / static 文件夹中找到静态文件(css,js,字体,img,...)。 endpoint.ex Plug.Static 。 Phoenix不知道在运行早午餐,webpack或/和gulp之前将这些文件放在哪个目录。



如何将Gulp / Sematic-UI配置设置为自动将文件放在正确的位置?



检出文件 ./ semantic.json 以设置gulp build命令的输出。



Mix可以自动运行Gulp / Semantic-UI构建吗?



,在程序包中添加脚本.json ,在 config / dev.exs

中修改观察者,这并不容易,建议您先开始使用 npm语义ui-css ,并且当您的构建工作良好时,切换到 npm语义ui


How do I add Semantic-UI to Phoenix?

Semantic-UI is installed in a folder and updated using NPM, and the actual CSS and Javascript files are built using GULP. Where should the full install folder be placed?

Can it be automatically updated through Mix like the rest of the dependencies?

Should the generated css and javascript be placed in project/web/static/css (or /js) or /vendor?

How do set up Gulp/Sematic-UI configuration to automatically put the files in the right places?

Again, can Mix run Gulp/Semantic-UI build automatically?

解决方案

Where should the full install folder be placed?

Actually, you just need 2 files: semantic.js & semantic.css. if you did npm install --save semantic-ui you should find them in ./semantic/dist/

So, where should these 2 files be placed? It depends on ... are you brunch or webpack? What is relevant to a phoenix app is to find the static files (css, js, font, img, ...) in the ./priv/static folder as you can see in the endpoint.ex Plug.Static. Phoenix is not aware of the directory where you did put these files before running brunch, webpack or/and gulp.

Can it be automatically updated through Mix ...

Yes, add a script in package.json, modify the watchers in config/dev.exs

Should the generated css and javascript be placed in project/web/static/css (or /js) or /vendor?

Same answer, are you brunch or webpack? What is relevant to a phoenix app is to find the static files (css, js, font, img, ...) in the ./priv/static folder as you can see in the endpoint.ex Plug.Static. Phoenix is not aware of the directory where you did put these files before running brunch, webpack or/and gulp.

How do set up Gulp/Sematic-UI configuration to automatically put the files in the right places?

Check out the file ./semantic.json to set up the output of the gulp build command.

can Mix run Gulp/Semantic-UI build automatically?

Yes, add a script in package.json, modify the watchers in config/dev.exs

This is not easy, and I recommend you to first start using npm semantic-ui-css and when your build works well to switch to npm semantic-ui

这篇关于如何将Semantic-UI添加到Phoenix的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆