2014-09-17 3 views
0

캐시 매니페스트를 사용하는 툴툴 거리는 앱을 만들고 있습니다. 내 문제는 하나의 모든 js 파일을 병합 및 축소 한 후 manifest.cfm이 다시 작성되지 않고 경로가 잘못 작성된다는 것입니다.메시지 사용 및 캐시 매니페스트

// Reads HTML for usemin blocks to enable smart builds that automatically 
// concat, minify and revision files. Creates configurations in memory so 
// additional tasks can operate on them 
useminPrepare: { 
    html: '<%= yeoman.app %>/index.html', 
    css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], 
    options: { 
    dest: '<%= yeoman.dist %>', 
    flow: { 
     html: { 
     steps: { 
      js: ['concat', 'uglifyjs'], 
      css: ['cssmin'] 
     }, 
     post: {} 
     } 
    } 
    } 
}, 

// Performs rewrites based on rev and the useminPrepare configuration 
usemin: { 
    html: ['<%= yeoman.dist %>/{,*/}*.html','<%= yeoman.dist %>/{,*/}*.tpl.html', '<%= yeoman.dist %>/views/templates{,*/}*.tpl.html'], 
    css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], 
    options: { 
    assetsDirs: ['<%= yeoman.dist %>', '<%= yeoman.dist %>/images', '<%= yeoman.dist %>/images/icons-app'] 
    } 
}, 

답변

0

나는 결국 손으로 쓰기 만들기 전에 manifest.cfm의 새로운 경로를 :

은 여기 내 Gruntfile.js의 일부입니다. 나는 실제로 어떤 쓸데없는 작업에 의해 자동으로 재 작성되도록하는 방법이 있는지 확신하지 못합니다.

0

"filerev"작업 양식에 무언가를 작성할 수 있습니다. 이렇게하면 새 빌드 후에 다시 작성하는 데 도움이됩니다.

+0

도이 작업을 수행 할 수 있습니다. https://www.npmjs.org/package/grunt-manifest-generator – vgrafe

2

나는 그 질문이 약간 오래된 것을 알고 있지만, 나는 비슷한 것을 풀었고, 도움이 될만한 답을 많이 찾을 수 없었다. 가장 좋은 방법은 filerev를 계속 사용하고 grunt-manifest 같은 불쾌한 명사 작성자를 사용하는 것입니다. 파일 이름이 업데이트 될 때 (filerev를 사용하여) 파일 이름이 변경되기를 원하므로 매니페스트 파일도 변경됩니다. 이것은 응용 프로그램 캐시가 업데이트해야한다는 것을 알 수있는 유일한 방법입니다.

manifest: { 
generate: { 
    options: { 
    basePath: 'app/', 
    network: ['*'], 
    preferOnline: true 
    }, 
    src: [ 
    'scripts/*.js', 
    'styles/*.css', 
    'images/*.*', 
    'views/{,*/}*.html' 
    ], 
    dest: 'dist/cache.manifest' 
} 
} 

추가 정보 : http://bnlconsulting.com/blog/the-browser-cache-and-angular

0

어쩌면이 스레드를 necromacing하지만이 :

당신이 꿀꿀 - 매니페스트 설치 한 후, 당신의 불평 소리 파일에서이 같은 설정은 물어 무엇을해야 https://github.com/JoshSchreuder/grunt-manifest-generator

주어진 html 파일을 스캔하고 자동으로 모든 javascript/css/html 파일을 포함합니다.