Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i add fingerprint to filename #2

Open
premhameed opened this issue May 12, 2017 · 2 comments
Open

How can i add fingerprint to filename #2

premhameed opened this issue May 12, 2017 · 2 comments

Comments

@premhameed
Copy link

I wanted to use fingerprint for all my js file. To avoiding some caching issue in share point
requirejs.config({

baseUrl: 'js/',
waitSeconds: 2,
paths: {
    fingerprint : 'lib/fingerprint',
    jquery:'lib/jquery'      
    //'bootstrap':'lib/bootstrap'
   
},
// config: {
//       fingerprint: {
//         fingerprints: {
//             'jquery':makeids(),        
//             'bootstrap':makeids()
//         },
//         options: {
//           prefix: '.',
//           mode: 'beforeExtension' // Can be "beforeExtension", "regex" or "append", default: append
//         }
//       }
//     },
config: {
  'fingerprint': 'version001'
},
shim: {        
    
    'bootstrap': ['jquery'],
    
         
},    
//urlArgs: "key=002" 

});

@meinaart
Copy link
Owner

Can you tell me a bit more about your project's structure?
What URL structure do you want?

Be aware that you need to prefix your resources that you want fingerprinted with "fingerprint!". There is an example folder in this project, you can try that out to see the impact of the config choices you make.

@premhameed
Copy link
Author

Thanks For your quick reply.
here is the code I am using but now it is throwing $ not defined error.
requirejs.config({

baseUrl: 'js/',
waitSeconds: 2,
paths: {
    fingerprint : 'lib/fingerprint',
    jquery:'lib/jquery',
   bootstrap:'lib/bootstrap.min'     
        
},

config: {
  'fingerprint': 'version001'
},
shim: {        
    
    'bootstrap': ['jquery'],
          
}   

});

require(['fingerprint!jquery'], function($) {

$(document).ready(function(){
    console.log('hello');
});

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants