Comments (5)
Sbt-web's approach is quite different. Rjs is now configured exactly as if you were using it outside of Play.
The purpose of WebJars is to leverage existing tooling and infrastructure.
My guess here is that an older version of play is included given the dependency on WebJars-play.
I'm going to close this issue for now.
from angular-seed-play.
Yes I thought that might be the case (new way of doing this), in this case could you give me some pointers as to how best achieve my use-case with sbt-web (loading the webjars-requirejs.js automatically based on the web jars dependencies declare in the build file) ?
We are considering moving to web jars at work and would need the use-case above. We are loading dozens of dependencies at the moment manually, and this is without any other tools --i.e., no NPM or requires etc, just the angular module loader / injector. I need to nail this down so we can begin porting our in house JS modules to web jars, but it wouldn't be worth the investment for the next project unless I can remove the boilerplate above.
Sorry, I'm really new to web-development and play in general. Learning the whole stack --i.e., angular, css, requires, JS, play, web unit testing etc simultaneously :(.
We are in the process of a typesafe subscription for our team :D Guess I could raise a ticket once it goes through.
from angular-seed-play.
You'll need to declare an rjs path config in your main.js - as per the project provided. The upside of this is that sbt-rjs looks for them and automatically substitutes CDN paths for the WebJars when you create a dist for production.
from angular-seed-play.
So is this the currently prescribed solution ?
requirejs.config({
paths: {
'angular': ['../lib/angularjs/angular'],
'angular-ui-router' : ['../lib/angular-ui-router/angular-ui-router'],
'angular-resource' : ['../lib/angularjs/angular-resource'],
'ui-bootstrap-tpls' : ['../lib/angular-ui-bootstrap/ui-bootstrap-tpls']
},
shim: {
'angular': {
exports: 'angular'
},
'angular-ui-router' : {
deps : ['angular']
},
'angular-resource' : {
deps : ['angular']
},
'ui-bootstrap-tpls' : {
deps :['angular']
}
}
});
require(['angular', './controllers', './directives', './filters', './services',
'angular-ui-router', 'angular-resource','ui-bootstrap-tpls'],
function(angular, controllers) {
...
}
This would become rather unwieldy when dozens of dependencies are involved.
from angular-seed-play.
I agree with you. However do you accept that this is an rjs issue and not really a WebJars one?
That said, we could probably re-instate some support for rjs in sbt-web if this becomes a common issue.
from angular-seed-play.
Related Issues (9)
- Wiring additional web jars as Angular dependencies. HOT 14
- Demonstrate using requirejs optimized files? HOT 5
- Provide examples for loading other angular modules HOT 6
- Demonstrate testing angular code HOT 17
- $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.