/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2604150425000
src/module.js
24 строки
538 B
Ryan Cebulko
♻️ Move files into #core, #utils to enable tsc typechecking (#36277)
07 окт 2021, 23:26
Не верифицирован
07 окт 2021, 23:26
b6d1550
Код
Авторство
О чём код?
import {dev} from '#utils/log'; const TAG = 'AMP.require'; /** * Allows `require`ing modules exported by non-AMP build code. * @param {string} module * @return {?} */ export function requireExternal(module) { const required = (AMP.dependencies && AMP.dependencies[module]) || (AMP.require && AMP.require(module)); if (required) { return required; } else { dev().error( TAG, 'Could not require external module %s.' + ' Did you import the bundle in the extension?', module ); } }