Skip to content

Commit

Permalink
update readme some more
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarkInn committed Dec 10, 2016
1 parent c35ca4e commit 34ebd40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
5 changes: 0 additions & 5 deletions examples/code-splitting-native-import-context/README.md
Expand Up @@ -3,11 +3,6 @@
This example illustrates how to leverage the `import()` syntax to create ContextModules which are separated into separate chunks for each module in the `./templates` folder.

``` javascript
// function getTemplate(templateName) {
// return import("./templates/"+templateName);
// }
// console.log(getTemplate("a"));
// console.log(getTemplate("b"));

async function getTemplate(templateName) {
try {
Expand Down
6 changes: 0 additions & 6 deletions examples/code-splitting-native-import-context/example.js
@@ -1,9 +1,3 @@
// function getTemplate(templateName) {
// return import("./templates/"+templateName);
// }
// console.log(getTemplate("a"));
// console.log(getTemplate("b"));

async function getTemplate(templateName) {
try {
let template = await import(`./templates/${templateName}`);
Expand Down
10 changes: 10 additions & 0 deletions examples/code-splitting-native-import-context/template.md
Expand Up @@ -11,6 +11,9 @@ This example illustrates how to leverage the `import()` syntax to create Context
* a.js
* b.js
* c.js
* foo.js
* baz.js
* bar.js

All templates are of this pattern:

Expand All @@ -20,6 +23,13 @@ module.exports = function() {
}
```

or (for ES6):

``` javascript
var foo = "foo";
export default foo;
```

# js/output.js

``` javascript
Expand Down

0 comments on commit 34ebd40

Please sign in to comment.