Comments (9)
I'd say all of them are good options, and the best approach would depend on the project. For the main product at the company I work at, for example, I'd like to adopt the 1).
from aura.
imo, 1) probably works best for quite a few scenarios.
from aura.
Has anybody an example for optimizing a widget into a single file via grunt? I tried a couple of options but I'm stuck. Would be great if someone could share an example
from aura.
Thank you @gersongoulart and @addyosmani for the response.
@DigitalHero i've investigated some options to build it like option 1) and here is a dirty wip snippet from my grunt:requirejs config - you might have to change the the src path:
modules: (function(){
var fs = require('fs'),
src = './js/widgets',
output = [];
//Add the main file
output.push({
name: 'app',
include: [ 'text' ]
});
fs.readdirSync(src).forEach(function(dirName){
output.push({
name: 'widgets/' + dirName + '/main',
exclude: ['sandbox', 'text']
});
});
return output;
})(),
removeCombined: true
from aura.
Thanks @henrikkok, your snippet works great. I think this should be included in the aura grunt.js
from aura.
@dustinboston what do you think about us including this in our grunt file by default?
from aura.
@DigitalHero glad it helped :-)
@addyosmani I can create a pull request, if the build process gets fixed (it's breaking atm).
from aura.
Thanks @henrikkok. I'll see what I can do to fix the build process tonight.
from aura.
@addyosmani Yes. That's perfect. We should document that the convention of main.js is a requirement for the build process. @henrikkok Nice work. Looks great.
from aura.
Related Issues (20)
- Doubt about duplicate element and maintain the associated events HOT 3
- Framework design flawed! Removing dependencies jQuery and Underscore. HOT 12
- Requirejs repair Tons of issues. HOT 1
- Mediator dependency removal Event Emitter HOT 3
- Support for loading of individually optimized components? HOT 15
- Asynchronous/dynamic loading of components? HOT 3
- Does Aurajs compatible with IE6? If not, how should I do to make it support?
- Error when manually loading a component
- Data management HOT 4
- ideas or plans about aura's job in relation with polymerjs HOT 5
- Can't go past a Grunt Task referring component initialize
- hi guys did you abandon the aura project? HOT 2
- Access to parent(super) methods within component HOT 1
- how to Concatenate the files of the decoupled modules HOT 4
- External links not working with Android webview HOT 1
- [BUSINESS CRITICAL] aurajs.com - github pages site is inaccessible HOT 6
- How to use jQuery and Flot with AuraJS ?
- Lightening component built upon aura js
- The project's domain is advertising some pocker stuff :)
- Aura
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 aura.