Comments (5)
This should "just work" but sounds like there is an issue somewhere. I thought #15 fixed this.
from angular-seed-play.
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.
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.
In that case, you aren't actually using the webjars, right? you are just using dependencies from a CDN?
from angular-seed-play.
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)
- Wiring additional web jars as Angular dependencies. HOT 14
- Provide examples for loading other angular modules HOT 6
- Demonstrate testing angular code HOT 17
- Demonstrate automatically wiring up the webjars-requirejs.js of the dependencies files with play 2.3 HOT 5
- $locationProvider.html5Mode(true) HOT 3
- dependency to require.js web jar is required
- how to serve minized files HOT 1
- Please update to current Play version HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-seed-play.