Home  >  Article  >  Backend Development  >  webpack - 现在的前端自动化工具中,有什么是可以替换.php文件中的css路径,和js路径的。

webpack - 现在的前端自动化工具中,有什么是可以替换.php文件中的css路径,和js路径的。

WBOY
WBOYOriginal
2016-06-06 20:26:081353browse

webpack - 现在的前端自动化工具中,有什么是可以替换.php文件中的css路径,和js路径的。

1.就是这样的php文件,我想要的效果是,可以将其中的css,js文件替换为,我已经压缩,加好md5,之后的文件路径。

回复内容:

webpack - 现在的前端自动化工具中,有什么是可以替换.php文件中的css路径,和js路径的。

1.就是这样的php文件,我想要的效果是,可以将其中的css,js文件替换为,我已经压缩,加好md5,之后的文件路径。

只知道 laravel中有 “压缩文件并加上哈希的版本号” : http://laravel-china.org/docs/5.0/elixir

建议你修改方法 addCss 和 addJs ,在处理 css 和 js 文件的时候统一处理。

ps: 看到 addCss 和 addJs 让我想到了国外的一个论坛系统 Vanilla 这个系统加载 css 和 js 的方式就是在控制器中调用 AddCssFile 和 AddJsFile 方法~

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn