"More code, less talk"
├── .editorconfig
├── .gitignore
├── LICENSE.md
├── README.md
├── gulpfile.js
├── package.json
├── proxies.js
├── src
├── app.config.js
├── app.startup.js
└── index.html
mkdir -p you-do-not-know-openui5/src
cd you-do-not-know-openui5
yarn init
yarn add -D gulpjs/gulp#4.0 gulp-mem browser-sync http-proxy-middleware
node_modules
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
indent_style = space
indent_size = 2
# Set default charset
charset = utf-8
const proxy = require('http-proxy-middleware');
module.exports =
/**
* openui5 runtime/mobile-runtime/sdk packages at http://openui5.org/download.html
*/
[
proxy("/resources", {
target: "https://openui5.hana.ondemand.com/1.50.8",
changeOrigin: true,
onProxyRes: (p) => {
p.headers["cache-control"] = "public, max-age=31536000"
}
}),
proxy("/test-resources", {
target: "https://openui5.hana.ondemand.com/1.50.8",
changeOrigin: true,
onProxyRes: (p) => {
p.headers["cache-control"] = "public, max-age=31536000"
}
})
];
let gulp = require('gulp');
let browserSync = require('browser-sync');
let GulpMem = require('gulp-mem');
// Configure gulp-mem plugin: base path, log
const gulpMem = new GulpMem();
gulpMem.serveBasePath = '/';
gulpMem.enableLog = true;
const copy = () => {
return gulp.src(['src/**/*']);
};
// Copy content of src folder to root path in-memory
gulp.task('app:build', () => {
return copy()
.pipe(gulpMem.dest('/'));
});
// Configure browser-sync, start server and open app in Chromium browser
gulp.task('bs:start', (done) => {
const middlewares = require('./proxies');
middlewares.push(gulpMem.middleware);
browserSync.init({
middleware: middlewares,
server: [
'/'
],
browser: 'Chromium'
});
done();
});
// Refresh browser page where app is running
gulp.task('bs:reload', (done) => {
browserSync.reload();
done();
});
// Watch for changes in src folder
// If any changes, run app:build and bs:reload in sequence
gulp.task('app:watch', () => {
gulp.watch('src/**/*', gulp.series('app:build', 'bs:reload'));
});
// Run app:build, bs:start and app:watch tasks in sequence
gulp.task('default', gulp.series('app:build', 'bs:start', 'app:watch'));
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>You Do Not Know Openui5</title>
<script id="sap-ui-config" src="app.config.js"></script>
<script id="sap-ui-resources" src="resources/sap-ui-core.js"></script>
<script id="sap-ui-startup" src="app.startup.js"></script>
</head>
<body id="content" class="sapUiBody"></body>
</html>
window["sap-ui-config"] = {
libs: "sap.m",
theme: "sap_belize",
preload: "sync",
manifestFirst: true,
bindingSyntax: "complex",
compatVersion: "edge",
debug: false,
logLevel: "NONE",
trace: false,
statistics: false,
"xx-debugModuleLoading": false,
"xx-debugRendering": false,
"xx-fakeOS": "",
"xx-showLoadErrors": true,
"xx-waitForTheme": true
};
sap.ui.getCore().attachInit(function () {
sap.ui.require([
], function () {
jQuery("#content").html("You Do Not Know Openui5")
});
});
gulp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |