Monday, November 7, 2016

Quick Tips on Development with Sharepoint Page Framework Preview using Visual Code

1. Generated the Sharepoint Page project under the Sharepoint Page Framework

  yo @microsoft/sharepoint

2. Debug the Project with Gulp run time

   Gulp Serve

3. Reference external reources manually
  •    go to the config folder, 
  •    open the config.json file
  •   under the externals section add one entry like  a reference to jquery in the CDN  with key "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"
  • use Import to add the reference the library in WebPart.ts  type script object 
         Import 'jquery'



4. Debug the project with Chrome in Visual Code
  •      installed the Debugger for Chrome extension
  •      run Gulp Serve to start the work process
  •    select Debug from View Menu
  •   click on the Start Button from Debug to launch the Chrome Browser  
 



5.  Load local javascript file. which is located at src\webparts\YourProjectNameFolder
   
open the type script object, add the following line to include the javascript in the load

 public render(): void {
      require('./yourJavascriptFileNameWithoutFileExtension');
  }



No comments:

Post a Comment