Skip to content

Asset loader doesn't transform file to web path #23

@megaponchic

Description

@megaponchic

Hi,

I'm using play 2.2.2 and assets-loader 0.11.8. After configuring it I tried to use it to concatenate css files. When I launched the app, the file was correctly generated and placed into target/.assets-loader-generated folder (in dev mode). However, the web path didn't lead to a file. Here is the last part of the log:

[debug] a.l.t.concatenator - name: /main-38678960.css
[trace] a.l.Sequence - transformer: com.ee.assets.transformers.Writer@4d68b29
[trace] a.l.new-loader - final path for generated asset: /Users/artem/vet/coiffure/target/.assets-loader-generated/main-38678960.css
[trace] a.l.Sequence - transformer: com.ee.assets.transformers.FileToWebPath@214a333a
[warn] a.l.file-to-web - /main-38678960.css doesn't contain public - so nothing to replace

After digging into source code I found that the last warning is coming from FileToWebPath.scala file within this code:

if (!p.contains(info.filePath)) {
      logger.warn(s"$p doesn't contain ${info.filePath} - so nothing to replace")
}

Just in case, here is my loader object

package util

import play.api.Play
import com.google.javascript.jscomp.CompilerOptions

object ScalaHelper{
  val defaultOptions = new CompilerOptions()
  defaultOptions.setLanguageIn(CompilerOptions.LanguageMode.ECMASCRIPT5)
  val compilerOptions: Option[CompilerOptions] = Some(defaultOptions)

  val loader = new com.ee.assets.Loader(None, Play.current.mode, Play.current.configuration, compilerOptions)
}

Thank you for the great tool and your help,
Artem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions