diff --git a/examples/javascript-advanced/dist/0714810ae3fb211173e2964249507195.png b/examples/javascript-advanced/dist/0714810ae3fb211173e2964249507195.png new file mode 100644 index 0000000..d71b3d7 Binary files /dev/null and b/examples/javascript-advanced/dist/0714810ae3fb211173e2964249507195.png differ diff --git a/examples/javascript-advanced/dist/bundle.js b/examples/javascript-advanced/dist/bundle.js new file mode 100644 index 0000000..29aa454 --- /dev/null +++ b/examples/javascript-advanced/dist/bundle.js @@ -0,0 +1,65 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + eval("__webpack_require__(1);\n\nvar universal = __webpack_require__(5);\nvar h1 = document.createElement('h1');\nh1.innerHTML = universal();\n\ndocument.body.appendChild(h1);\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./example.js\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./example.js?"); + +/***/ }, +/* 1 */ +/***/ function(module, exports) { + + eval("// removed by extract-text-webpack-plugin\n\n/*****************\n ** WEBPACK FOOTER\n ** ./main.css\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./main.css?"); + +/***/ }, +/* 2 */, +/* 3 */, +/* 4 */, +/* 5 */ +/***/ function(module, exports) { + + eval("// This file is used for frontend and backend\n'use strict';\n\n// If compiled by the html-webpack-plugin\n// HTML_WEBPACK_PLUGIN is set to true:\nvar backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined';\n\nmodule.exports = function () {\n return 'Hello World from ' + (backend ? 'backend' : 'frontend');\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./universial.js\n ** module id = 5\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./universial.js?"); + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/examples/javascript-advanced/dist/index.html b/examples/javascript-advanced/dist/index.html new file mode 100644 index 0000000..194f6fb --- /dev/null +++ b/examples/javascript-advanced/dist/index.html @@ -0,0 +1,2 @@ +
\ No newline at end of file
diff --git a/examples/javascript-advanced/dist/styles.css b/examples/javascript-advanced/dist/styles.css
new file mode 100644
index 0000000..232a2cd
--- /dev/null
+++ b/examples/javascript-advanced/dist/styles.css
@@ -0,0 +1,3 @@
+body {
+ background: snow;
+}
\ No newline at end of file
diff --git a/examples/javascript-advanced/example.js b/examples/javascript-advanced/example.js
new file mode 100644
index 0000000..e5aff3b
--- /dev/null
+++ b/examples/javascript-advanced/example.js
@@ -0,0 +1,7 @@
+require('./main.css');
+
+var universal = require('./universial.js');
+var h1 = document.createElement('h1');
+h1.innerHTML = universal();
+
+document.body.appendChild(h1);
diff --git a/examples/javascript-advanced/logo.png b/examples/javascript-advanced/logo.png
new file mode 100644
index 0000000..d71b3d7
Binary files /dev/null and b/examples/javascript-advanced/logo.png differ
diff --git a/examples/javascript-advanced/main.css b/examples/javascript-advanced/main.css
new file mode 100644
index 0000000..232a2cd
--- /dev/null
+++ b/examples/javascript-advanced/main.css
@@ -0,0 +1,3 @@
+body {
+ background: snow;
+}
\ No newline at end of file
diff --git a/examples/javascript-advanced/partial.html b/examples/javascript-advanced/partial.html
new file mode 100644
index 0000000..47dc0f7
--- /dev/null
+++ b/examples/javascript-advanced/partial.html
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/examples/javascript-advanced/readme.md b/examples/javascript-advanced/readme.md
new file mode 100644
index 0000000..64d224d
--- /dev/null
+++ b/examples/javascript-advanced/readme.md
@@ -0,0 +1,4 @@
+# isomorphic javascript-advanced example
+
+This example is similar to the javascript example however it allows takes
+parameters from the config and works asynchronously
\ No newline at end of file
diff --git a/examples/javascript-advanced/template.js b/examples/javascript-advanced/template.js
new file mode 100644
index 0000000..bd0f705
--- /dev/null
+++ b/examples/javascript-advanced/template.js
@@ -0,0 +1,13 @@
+// Webpack require:
+var partial = require('./partial.html');
+var universal = require('./universial.js');
+
+// Export a function / promise / or a string:
+// This function has to return a string or promised string:
+module.exports = function (templateParams) {
+ var html = '' +
+ '