javascript 如何在 TYPO3 中压缩我的 js/css 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4992048/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 15:36:14 来源:igfitidea点击:
How can I compress my js/css files in TYPO3
提问by koalabruder
how can I compress (minify) my JavaScript and CSS files dynamically in TYPO3?
如何在 TYPO3 中动态压缩(缩小)我的 JavaScript 和 CSS 文件?
Thanks
谢谢
采纳答案by StephenKing
I suggest using the scriptmerger extension. It automatizes this task for you.
我建议使用 scriptmerger 扩展。它会为您自动执行此任务。
回答by user1308909
You could use Typoscript (since 4.6):
您可以使用 Typoscript(自 4.6 起):
config {
concatenateJs = 1
concatenateCss = 1
compressJs = 1
compressCss = 1
}
page {
includeJS {
myFile1 = fileadmin/js_file1.js
myFile2 = fileadmin/js_file2.js
myFile2.excludeFromConcatenation = 1
}
includeCSS {
myFile1 = fileadmin/css_file1.css
myFile2 = fileadmin/css_file2.css
myFile2.disableCompression = 1
}
}
See the TSref documentation
请参阅TSref 文档

