
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
babel-plugin-onex-utils
Advanced tools
onex-utils工具库的babel插件,挑选出你使用onex-utils的模块,剔除未使用的模块,减小项目引用
$ npm i --save onex-utils
$ npm i --save-dev babel-plugin-onex-utils @babel/cli @babel/preset-env
Transforms
import { capitalize, map } from 'onex-utils';
map([], capitalize);
roughly to
"use strict";
var _map2 = _interopRequireDefault(require("onex-utils/build/map"));
var _capitalize2 = _interopRequireDefault(require("onex-utils/build/capitalize"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
(0, _map2["default"])([], _capitalize2["default"]);
.babelrc
{
"plugins": ["onex-utils"],
"presets": [["@babel/env", { "targets": { "node": 6 } }]]
}
Babel API
require('babel-core').transform('code', {
'plugins': ['onex-utils'],
'presets': [['@babel/env', { 'targets': { 'node': 6 } }]]
})
webpack.config.js
'module': {
'loaders': [{
'loader': 'babel-loader',
'test': /\.js$/,
'exclude': /node_modules/,
'query': {
'plugins': ['onex-utils'],
'presets': [['@babel/env', { 'targets': { 'node': 6 } }]]
}
}]
}
ast语法树中Program节点分析整个import语句中引用import中每个local节点的,获取到对应的节点和引用,然后遍历这些引用,通过@babel/helper-module-imports创建新形式的import,并替换原有的语法ImportDeclaration过程删除对应的默认引用export形式的导出,首先将其转化成单个依赖的import语句,然后在进行变量导出FAQs
> TODO: description
The npm package babel-plugin-onex-utils receives a total of 1 weekly downloads. As such, babel-plugin-onex-utils popularity was classified as not popular.
We found that babel-plugin-onex-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.