8 Star 9 Fork 0

Gitee 极速下载 / accelerated-mobile-pages

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/ampproject/amphtml
克隆/下载
babel.config.js 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
erwin mombay 提交于 2022-08-04 13:17 . turn on ssr css (#38383)
/**
* @fileoverview Global configuration file for various babel transforms.
*
* Notes: From https://babeljs.io/docs/en/plugins#plugin-ordering:
* 1. Plugins run before Presets.
* 2. Plugin ordering is first to last.
* 3. Preset ordering is reversed (last to first).
*/
'use strict';
const {cyan, yellow} = require('kleur/colors');
const {log} = require('./build-system/common/logging');
/**
* Mapping of each babel transform caller to the name of the function that
* returns its config.
*/
const babelTransforms = new Map([
['babel-jest', 'getEmptyConfig'],
['nomodule-loader', 'getNoModuleLoaderConfig'],
['test', 'getTestConfig'],
['unminified', 'getUnminifiedConfig'],
['unminified-ssr-css', 'getUnminifiedSsrCssConfig'],
['minified', 'getMinifiedConfig'],
['minified-ssr-css', 'getMinifiedSsrCssConfig'],
['jss', 'getJssConfig'],
['@babel/eslint-parser', 'getEslintConfig'],
['is-enum-value', 'getEmptyConfig'],
['import-resolver', 'getEmptyConfig'],
['react-minified', 'getReactMinifiedConfig'],
['react-unminified', 'getReactUnminifiedConfig'],
]);
/**
* Main entry point. Returns babel config corresponding to the caller, or an
* empty object if the caller is unrecognized. Configs are lazy-required when
* requested so we don't unnecessarily compute the entire set for all callers.
*
* @param {!Object} api
* @return {!Object}
*/
module.exports = function (api) {
const callerName = api.caller((callerObj) => {
return callerObj ? callerObj.name : '<unnamed>';
});
if (callerName && babelTransforms.has(callerName)) {
const configFunctionName = babelTransforms.get(callerName);
return require('./build-system/babel-config')[configFunctionName]();
} else {
log(
yellow('WARNING:'),
'Unrecognized Babel caller',
cyan(callerName),
'(see babel.config.js).'
);
return {};
}
};
JavaScript
1
https://gitee.com/mirrors/accelerated-mobile-pages.git
git@gitee.com:mirrors/accelerated-mobile-pages.git
mirrors
accelerated-mobile-pages
accelerated-mobile-pages
main

搜索帮助