Git Product home page Git Product logo

Comments (5)

jamesward avatar jamesward commented on June 19, 2024

This should "just work" but sounds like there is an issue somewhere. I thought #15 fixed this.

from angular-seed-play.

pkaeding avatar pkaeding commented on June 19, 2024

When I run stage on this project, I see this error, and I see the js files being loaded individually:

[info] RequireJS optimization has begun...
[info] app.build.js:
[info] ({appDir: "javascripts",
[info]           baseUrl: ".",
[info]           dir:"javascripts-min", mainConfigFile: "javascripts/app.js", modules: [{name: "app"}]})
Error: /private/tmp/angular-seed-play/target/scala-2.10/classes/public/javascripts/app.js does not exist.
[info] RequireJS optimization finished.

From reading the play docs, it sounds like its optimizer only runs over javascript files in app/assets/javascripts, not public/js.

So, in my own project, I moved my js code there. When I run stage, I see this error:

[info] RequireJS optimization has begun...
[info] app.build.js:
[info] ({appDir: "javascripts",
[info]           baseUrl: ".",
[info]           dir:"javascripts-min", mainConfigFile: "javascripts/app.js", modules: [{name: "app"}]})

Tracing dependencies for: app
JavaException: java.io.FileNotFoundException: /Users/pkaeding/prj/gmaps-play/target/scala-2.10/classes/public/javascripts-min/jquery.js (No such file or directory)
In module tree:
    app

jQuery is loaded properly from webjars when I run in dev mode, so I'm not sure what is happening there. When I try to run my app in production mode, my app.js 404s, which I guess is not surprising, because clearly there was a problem generating it.

from angular-seed-play.

jamesward avatar jamesward commented on June 19, 2024

Well this is nasty but RequireJS needs to see the WebJar contents for some reason. And the WebJar contents are inside Jars. Here is a possible workaround:
https://github.com/typesafehub/angular-seed-play/compare/minify-support

This all gets better in Play 2.3 with sbt-web. Until then we might need some hacks.

from angular-seed-play.

pkaeding avatar pkaeding commented on June 19, 2024

In that case, you aren't actually using the webjars, right? you are just using dependencies from a CDN?

from angular-seed-play.

jamesward avatar jamesward commented on June 19, 2024

That is just for the requirejs optimizer to run. I don't think in this case it actually uses them from the CDN at runtime because I'm not actually using that config at runtime.

from angular-seed-play.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.