2015-05-20 22 views
10

La struttura del progetto attuale è un po 'come questo:grugnito-wiredep su più file con diverse dipendenze

-index.html 
| 
-bower.json 
| 
+-bower_components 

La struttura del progetto proposto aggiungerà un paio di file html più statici nella radice del progetto. Fino ad ora ho gestito tutte le dipendenze frontend in bower.json e l'ho incluso automaticamente in index.html utilizzando l'attività grunt-wiredep. Ma con l'aggiunta di nuovi file, ogni file avrà un diverso insieme di dipendenze.

-index.html 
| 
-file-with-some-other-bower-dependency.html 
| 
-bower.json 
| 
+bower_components 

Quale sarebbe un modo efficiente di gestire questi file con diverse dipendenze bower?

+1

grugnito-wiredep Aggiungi riferimento per i file elencati nel 'di proprietà main' di un pacchetto. Esegue la scansione dei file menzionati e aggiunge automaticamente queste dipendenze. Non penso che quello che stai cercando di ottenere sia possibile. –

+0

È un progetto in angularjs? –

risposta

1

si possono fare due compito diverso, ognuno con le proprie dipendenze (bowerJson):

grunt.initConfig({ 
wiredep: { 
    app: { 
    src: 'index.html', 
    "bowerJson":{ 
     "dependencies": { 
     "jquery":"=2.1.3", 
      ... 
     } 
    } 

    }, 
    app2: { 
    src: 'file-with-some-other-bower-dependency.html', 
    "bowerJson": { 
     "dependencies": { 
     "bootstrap": "~3.0.0", 
     ... 
     } 
    } 
    }}