Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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.
https://github.com/paulirish/html5-boilerplate/pull/705

fixes #705.

Squashed commit of the following:

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

    adding file.root.script property to default.properties

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

commit 27011c0
Author: calvin <calvin@darktable.com>
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...
commit 7467f9c0417a0c1f9863e2d000aad73f34836ef2 1 parent 2aabc1a
@paulirish paulirish authored
Showing with 10 additions and 5 deletions.
  1. +5 −5 build/build.xml
  2. +5 −0 build/config/default.properties
View
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}"/>
</fileset>
</concat>
</target>
@@ -516,7 +516,6 @@
</concat>
<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" />
</target>
@@ -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}"/>
</fileset>
</copy>
<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}"/>
</replaceregexp>
<!--[! 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}"/>
</replaceregexp>
View
5 build/config/default.properties
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.