Skip to content

Commit

Permalink
Auto-create target .js files if not present.
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualirfan committed Jan 14, 2018
1 parent 7bea1da commit a9267d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/sri/sbt/platform/ConfigBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ object ConfigBuilder {
artifactPath in fullOptJS := baseDirectory.value / aPath,
dev := {
val indexFile = baseDirectory.value / entryFile
IO.touch(indexFile, setModified = false)
val indexContent = IO.read(indexFile)
(fastOptJS in config).value.data
val launcher = s"""require("./$aPath");"""
if (!indexContent.contains(launcher)) IO.append(indexFile, launcher)
},
prod := {
val indexFile = baseDirectory.value / entryFile
IO.touch(indexFile, setModified = false)
val indexContent = IO.read(indexFile)
(fullOptJS in config).value.data
val launcher = s"""require("./$aPath");"""
Expand Down

0 comments on commit a9267d9

Please sign in to comment.