Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
基于babel6的edp插件。
$ npm i edpx-babel babel-preset-browser --save-dev
Webserver(edp-webserver-config.js)
var babel = require('edpx-babel/lib/babel-handler');
// 注意babel函数的参数是babel6的配置项目,所有参数都可以在babel官网上查到
// http://babeljs.io/docs/usage/options/
exports.getLocations = function () {
return [
{
location: /\.js($|\?)/,
handler: [
babel({
presets: ['babel-preset-browser']
})
]
}
];
};
Builder(edp-build-config.js)
var BabelProcessor = require('edpx-babel/lib/BabelProcessor');
// 注意babel函数的参数是babel6的配置项目,所有参数都可以在babel官网上查到
// http://babeljs.io/docs/usage/options/
exports.getProcessors = function () {
var html2jsProcessor = new processors.Html2JsCompiler({
files: ['*.es'],
compileOptions: {
presets: ['babel-preset-browser']
}
});
};
项目使用的配置与babel6完全一致,可以参考babel6配置手册。
推荐:
在ES6的特性选择上,babel-preset-browser会剔除所有依赖ES5的Getter/Setter或者getPrototypeOf函数的功能。其它特性是基本一致的。
FAQs
edp plugin of babel
We found that edpx-babel 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.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.