Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
babel-preset-vnmf
Advanced tools
The Babel configuration of the Vnmf project is located in the babel.config.js
file in the root directory, which adds a preset by default: babel-preset-vnmf
, which will add some commonly used presets
and according to the project's technology stack plugins
.
module.exports = {
presets: [
['vnmf', {/** configuration items */}]
]
}
Developers can modify babel.config.js
, modify the configuration items of babel-preset-vnmf
, or add presets
and plugins
they want.
babel-preset-vnmf
will selectively use the following presets
and plugins
according to the current project's technology stack.
@babel/preset-env
@babel/preset-typescript
(TypeScript environment)@babel/plugin-transform-runtime
@babel/plugin-proposal-decorators
@babel/plugin-proposal-class-properties
babel-plugin-dynamic-import-node
(applet environment)@babel/preset-react
react-refresh/babel
@vue/babel-preset-jsx
@vue/babel-plugin-jsx
The configuration items of babel-preset-vnmf
will be described in detail below.
:::note Only works when using React. :::
Default value: 'automatic'
The runtime configuration of @babel/preset-react
.
:::note Only works when using React. :::
default: true
Whether to introduce react-refresh/babel
to support using fast-refresh.
:::note Only works when using Vue/Vue3. :::
default: true
type: true
| false
| object
Whether to use @vue/babel-preset-jsx
(Vue) or @vue/babel-plugin-jsx
(Vue3) to support using jsx
.
When passing an object
, it is equivalent to setting true
, and the object
will be used as @vue/babel-preset-jsx
(Vue) or @vue/babel-plugin-jsx
( Vue3) parameters.
Defaults:
{
ios: '9',
android: '5'
}
The targets configuration item of @babel/preset-env
.
Default value: false
Valid values: 'entry'
| 'usage'
| false
:::info
Advantage: Completely global polyfill, even if there is incompatible code in the dependencies in node_modules
, it can run successfully.
Disadvantages: May introduce redundant code, affect global variables. :::
When 'entry'
is passed, the useBuiltIns option of @babel/preset-env
will be set to ' entry'
, the corejs option is set to '3'
.
Developers need to import core-js
in the entry file app.js
:
import "core-js"
Babel will introduce the corresponding core-js
dependencies according to targets. For example, the above code will compile to:
import "core-js/modules/es.string.pad-start";
import "core-js/modules/es.string.pad-end";
// ...
Of course, because Vnmf sets
corejs
to'3'
at this time, you can usecore-js@3
The ability to manually import on demand, please refer to the [document](https:/ /babeljs.io/docs/en/babel-preset-env#usebuiltins).
:::info Advantages: Introduced on demand, does not affect global variables.
Disadvantage: Dependencies in node_modules
are not processed by default, and babel-loader
needs to be configured manually.
:::
When 'usage'
is passed, the corejs option of @babel/plugin-transform-runtime
will be Set to 3
.
Note: When passing
'usage'
, Vnmf does not useuseBuiltIns: 'usage'
of@babel/preset-env
butcorejs: 3 of
@babel/plugin-transform-runtime. The reasons are: 1. When the two are set at the same time, there will be conflicts. Second, the latter, relative to the former, does not affect global variables.
When false
is passed, the useBuiltIns option of @babel/preset-env
will be set to false
, core-js
will not be imported at this time.
Default value: false
It is also the loose
configuration item of @babel/preset-env
and @babel/plugin-proposal-class-properties
.
Default value: false
The debug configuration item of @babel/preset-env
.
Default value: false
The modules configuration item of @babel/preset-env
.
spec configuration item for @babel/preset-env
.
The configPath configuration item of @babel/preset-env
.
###include
The include configuration item of @babel/preset-env
.
The exclude configuration item of @babel/preset-env
.
The shippedProposals configuration item of @babel/preset-env
.
The forceAllTransforms configuration item of @babel/preset-env
.
The decoratorsBeforeExport configuration item of @babel/plugin-proposal-decorators
.
default: true
The lagacy configuration item of @babel/plugin-proposal-decorators
.
default: The path to @babel/plugin-transform-runtime
in the developer root node_modules
.
type: string
The absoluteRuntime configuration item of @babel/plugin-transform-runtime
.
default: The version number of @babel/plugin-transform-runtime
in the developer root node_modules
.
type: string
The version configuration item of @babel/plugin-transform-runtime
.
FAQs
Vnmf babel preset
The npm package babel-preset-vnmf receives a total of 41 weekly downloads. As such, babel-preset-vnmf popularity was classified as not popular.
We found that babel-preset-vnmf 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.