开发者

How can I compress my js/css files in TYPO3

开发者 https://www.devze.com 2023-02-11 10:24 出处:网络
how can I compr开发者_JAVA技巧ess (minify) my JavaScript and CSS files dynamically in TYPO3? ThanksYou could use Typoscript (since 4.6):

how can I compr开发者_JAVA技巧ess (minify) my JavaScript and CSS files dynamically in TYPO3?

Thanks


You could use Typoscript (since 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


I suggest using the scriptmerger extension. It automatizes this task for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消