diff --git a/resources/docs/docs/chapters/tp/bundle2.md b/resources/docs/docs/chapters/tp/bundle2.md index 1cf57afbc37887dd7348254e6f88ae70a84f6f6e..34cfd5bca8f74037e1272545ee52030c26759ef9 100644 --- a/resources/docs/docs/chapters/tp/bundle2.md +++ b/resources/docs/docs/chapters/tp/bundle2.md @@ -43,3 +43,53 @@ After this chapter, thanks to the _ES modules_, there will be no more imported f - Remove the _IIFE_ - Write an `export` statement to export the component's function. - Write an `import` statement to import the `parseUrl` function if required. + +??? note "Show the resulting files" + + === "welcome.js" + + ```js linenums="1" + export function WelcomeComponent() {} + + /* method WelcomeComponent.init */ + WelcomeComponent.prototype.init = function init() { + // ... + }; + + // ... + ``` + === "game.js" + + ```js linenums="1" + import { parseUrl } from "./utils"; + + var environment = { + api: { + host: "http://localhost:8081", + }, + }; + + export function GameComponent() { + // ... + } + + /* method GameComponent.init */ + GameComponent.prototype.init = function init() { + // ... + }; + // ... + ``` + + === "score.js" + + ```js linenums="1" + import { parseUrl } from "./utils"; + + export function ScoreComponent() { + // ... + } + // ... + ``` + + +