module.exports = function (grunt) {
"use strict";
var proxy = require('http-proxy-middleware')
grunt.loadNpmTasks('grunt-browser-sync');
var odataProxy = proxy('/sap', { // Proxy all calls till /sap to our netweaver server, this includes base project for extension projects and odata calls
target: '<hostname of neteweaver stack for extension projects and odata>',
changeOrigin: false // for vhosted sites
})
var resourcesProxy = proxy('/resources', { // UI5 and Fiori resources from SAPs CDN, could point to local netweaver stack also
target: 'https://sapui5.hana.ondemand.com',
changeOrigin: true // for vhosted sites
})
var testResourcesProxy = proxy('/test-resources', { // UI5 and Fiori resources from SAPs CDN, could point to local netweaver stack also
target: 'https://sapui5.hana.ondemand.com',
changeOrigin: true // for vhosted sites
})
grunt.initConfig({
browserSync: { // Setup browsersync to watch javascript files for changes
default_options : {
bsFiles: {
src : '**/*,js'
},
options: {
server: {
baseDir: ['webapp'],
middleware: [odataProxy,resourcesProxy,testResourcesProxy]
},
startPath: '/test-resources/sap/ushell/shells/sandbox/fioriSandbox.html' // Set start path to the fiori launchpad sandbox provided by the Fiori SDK
}
},
},
});
grunt.registerTask("default", [ // Start a webserver with three reverse proxies
"browserSync",
]);
};
{
"name": "Hello World",
"version": "0.0.1",
"description": "",
"private": true,
"devDependencies": {
"@sap/grunt-sapui5-bestpractice-build": "1.3.62",
"grunt": "^1.0.3",
"grunt-browser-sync": "^2.2.0",
"grunt-cli": "^1.3.2",
"http-proxy-middleware": "^0.19.1"
}
}
@sap:registry=https://npm.sap.com/
{
"applications" : {
"HelloWorld-display" : {
"additionalInformation" : "SAPUI5.Component=cus.crm.myaccounts.HelloWorld",
"applicationType" : "URL",
"url" : "/",
"title" : "Hello World",
"description" : "App that says Hello World"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
12 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |