xref: /third_party/node/test/fixtures/es-module-loaders/byop-dummy-loader.mjs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/es-module-loaders/
11cb0ef41Sopenharmony_ciexport function load(url, context, nextLoad) {
21cb0ef41Sopenharmony_ci  switch (url) {
31cb0ef41Sopenharmony_ci    case 'byop://1/index.mjs':
41cb0ef41Sopenharmony_ci      return {
51cb0ef41Sopenharmony_ci        source: 'console.log("index.mjs!")',
61cb0ef41Sopenharmony_ci        format: 'module',
71cb0ef41Sopenharmony_ci        shortCircuit: true,
81cb0ef41Sopenharmony_ci      };
91cb0ef41Sopenharmony_ci    case 'byop://1/index2.mjs':
101cb0ef41Sopenharmony_ci      return {
111cb0ef41Sopenharmony_ci        source: 'import c from "./sub.mjs"; console.log(c);',
121cb0ef41Sopenharmony_ci        format: 'module',
131cb0ef41Sopenharmony_ci        shortCircuit: true,
141cb0ef41Sopenharmony_ci      };
151cb0ef41Sopenharmony_ci    case 'byop://1/sub.mjs':
161cb0ef41Sopenharmony_ci      return {
171cb0ef41Sopenharmony_ci        source: 'export default 42',
181cb0ef41Sopenharmony_ci        format: 'module',
191cb0ef41Sopenharmony_ci        shortCircuit: true,
201cb0ef41Sopenharmony_ci      };
211cb0ef41Sopenharmony_ci    case 'byop://1/index.byoe':
221cb0ef41Sopenharmony_ci      return {
231cb0ef41Sopenharmony_ci        source: 'console.log("index.byoe!")',
241cb0ef41Sopenharmony_ci        format: 'module',
251cb0ef41Sopenharmony_ci        shortCircuit: true,
261cb0ef41Sopenharmony_ci      };
271cb0ef41Sopenharmony_ci    default:
281cb0ef41Sopenharmony_ci      return nextLoad(url, context);
291cb0ef41Sopenharmony_ci  }
301cb0ef41Sopenharmony_ci}
31

Indexes created Thu Nov 07 10:32:03 CST 2024