babel-plugin-wildcard:通配符导入可导入目录JS文件

时间:2024-05-19 18:24:26
【文件属性】:

文件名称:babel-plugin-wildcard:通配符导入可导入目录JS文件

文件大小:41KB

文件格式:ZIP

更新时间:2024-05-19 18:24:26

babel-plugin JavaScript

babel-plugin-wildcard 允许您在编译时从目录import所有文件。 安装 $ npm install babel-plugin-wildcard 用法 通过.babelrc (推荐) .babelrc { " plugins " : [ " wildcard " ] } 通过CLI $ babel --plugins include script.js 通过节点API require ( 'babel' ) . transform ( 'code' , { plugins : [ 'wildcard' ] } ) ; 例子 具有以下文件夹结构: |- index.js |- dir |- a.js |- b.js |- c.js 以下JS: import * as Items from './dir' ; 将被编译为:


【文件预览】:
babel-plugin-wildcard-master
----.gitignore(583B)
----.babelrc(45B)
----package.json(889B)
----package-lock.json(89KB)
----src()
--------index.js(10KB)
----LICENSE(1KB)
----index.js(611B)
----README.md(4KB)
----.npmignore(24B)
----test()
--------index.js(1KB)
--------fixtures()

网友评论