Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

script.js and style.css both retain their path prefix when being swap…

…ped out for the concatenated/minified versions.

by @darktable.

fixes #705.

Squashed commit of the following:

commit 6a77f5a
Author: calvin <>
Date:   Tue Aug 16 21:12:10 2011 -0700

    adding file.root.script property to

    this allows people to rename script.js and not have to hack through
    build.xml to keep everything working.

commit 27011c0
Author: calvin <>
Date:   Tue Aug 16 20:51:48 2011 -0700

    revert to normal css and js paths

    had testing paths in the previous commit.

(and some other merge happiness)
  • Loading branch information...
1 parent 2aabc1a commit 7467f9c0417a0c1f9863e2d000aad73f34836ef2 @paulirish paulirish committed
Showing with 10 additions and 5 deletions.
  1. +5 −5 build/build.xml
  2. +5 −0 build/config/
10 build/build.xml
@@ -486,7 +486,7 @@
<concat destfile="./${dir.intermediate}/${dir.js}/scripts-concat.js" overwrite="no">
<fileset dir="./${dir.intermediate}/">
<include name="${dir.js.main}/plugins.js"/>
- <include name="${dir.js.main}/script.js"/>
+ <include name="${dir.js.main}/${file.root.script}"/>
@@ -516,7 +516,6 @@
<checksum file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" algorithm="sha" property="scripts.sha" />
<property name="scripts.js" value="${dir.js}/${scripts.sha}.js" />
<copy file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" tofile="${dir.publish}/${dir.js}/${scripts.sha}.js" />
@@ -552,7 +551,7 @@
<exclude name="${dir.js}/mylibs-concat.js"/>
<exclude name="${dir.js}/scripts-concat.min.js"/>
<exclude name="${dir.js}/plugins.js"/>
- <exclude name="${dir.js}/script.js"/>
+ <exclude name="${dir.js}/${file.root.script}"/>
<copy todir="${dir.publish}/${dir.js.mylibs}/">
@@ -609,14 +608,15 @@
<echo message="Update the HTML to reference our concatenated script file: ${scripts.js}"/>
<!-- style.css replacement handled as a replacetoken above -->
- <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*?!-- end ((scripts)|(concatenated and minified scripts))\s?--&gt;" replace="&lt;script defer src='${scripts.js}\'&gt;&lt;/script&gt;" flags="m">
+ <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*&lt;script.*src=['&quot;]?(.*)/${file.root.script}(?:\?.*)?['&quot;]?\s*&gt;\s*&lt;/script&gt;[\d\w\s\W]*&lt;!-- end ((scripts)|(concatenated and minified scripts))\s*--&gt;"
+ replace="&lt;script defer src='\1/${scripts.sha}.js\'&gt;&lt;/script&gt;" flags="m">
<fileset dir="${dir.intermediate}" includes="${page-files}"/>
<!--[! use comments like this one to avoid having them get minified -->
<echo message="Updating the HTML with the new css filename: ${style.css}"/>
- <replaceregexp match="&lt;link rel=['&quot;]?stylesheet['&quot;]?\s+href=['&quot;]?(.*)/style.css(?:\?.*)?['&quot;]?\s*&gt;"
+ <replaceregexp match="&lt;link rel=['&quot;]?stylesheet['&quot;]?\s+href=['&quot;]?(.*)/${file.root.stylesheet}(?:\?.*)?['&quot;]?\s*&gt;"
replace="&lt;link rel='stylesheet' href='\1/${css.sha}.css'&gt;" flags="m">
<fileset dir="${dir.intermediate}" includes="${page-files}"/>
5 build/config/
@@ -52,6 +52,11 @@ file.default.exclude = .gitignore, .project, .settings, README.markdown,
# If set, these files will not be optimized (minifications, concatinations, image optimizations will not be applied)
# Note: you cannot declare an empty file.default.bypass property
+# Root Script file
+# this is the file that will be swapped for the concatenated and minified javascript.
+file.root.script = script.js
# Root Stylesheet

0 comments on commit 7467f9c

Please sign in to comment.
Something went wrong with that request. Please try again.