How to do it...

  1. Open your command-line application, navigate to your workspace, and create a new node package:
    mkdir 02-creating-client-bundles
    cd 02-creating-client-bundles
    npm init -y
  1. Duplicate the main.js file from the Nesting modules under a single namespace recipe in Chapter 1, Building with Modules:
// main.js 
import { atlas, saturnV } from './rockets/index.js' 
 
export function main () { 
  saturnV.launch(); 
  atlas.launch(); 
} 
  1. Create the rockets dependencies directory (these files can be copied from Nesting modules under a single namespace recipe in Chapter 1, Building with Modules):
// rockets/index.js import * as saturnV from './saturn-v.js'; import * as atlas from './atlas.js'; export { saturnV, atlas }; // rockets/launch-sequence.js ...

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.