From 4659ffa255379a7b490a786cb2d1df571da2237b Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Sun, 20 Jul 2025 15:23:40 +0000 Subject: [PATCH] Update README.md --- README.en.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 24 ++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..bbbdf1d --- /dev/null +++ b/README.en.md @@ -0,0 +1,91 @@ +# Babel Plugin for Adding Import Sources to Runtime Helpers + +This package implements a Babel plugin that adds import sources to runtime helpers. + +## Installation + +```bash +npm install --save-dev babel-plugin-add-source-imports +``` + +## Usage + +### As a Babel Plugin + +1. Install the plugin: + + ```bash + npm install --save-dev babel-plugin-add-source-imports + ``` + +2. Add it to your Babel configuration: + + ```json + { + "plugins": ["add-source-imports"] + } + ``` + +## What This Plugin Does + +This plugin modifies Babel-generated runtime helper functions by adding import statements pointing to the source module for each helper function. + +For example, given this source code: + +```js +class Foo {} +``` + +Babel will generate code similar to: + +```js +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Foo = void 0; + +var _Foo = /*#__PURE__*/ _createClass(function Foo() { + "use strict"; + + Object.defineProperty(this, "__esModule", { + value: true + }); + this.Foo = void 0; + _classCallCheck(this, Foo); +}); + +exports.Foo = _Foo; +``` + +This plugin will modify the generated code to include import statements for Babel runtime helpers: + +```js +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Foo = void 0; + +var _classCallCheck = require("./utils/classCallCheck"); + +var _createClass = require("./utils/createClass"); + +var _Foo = /*#__PURE__*/ _createClass(function Foo() { + "use strict"; + + Object.defineProperty(this, "__esModule", { + value: true + }); + this.Foo = void 0; + _classCallCheck(this, Foo); +}); + +exports.Foo = _Foo; +``` + +## License + +MIT \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a34d18e --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ + + +# LVGL Notes + +这是一个用于记录 LVGL 学习和使用经验的仓库。 + +## 安装 + +1. 安 +2. 创建一个新的仓库 +3. 将本仓库克隆到本地 +4. 将本仓库作为插件添加到 Obsidian 应用中 + +## 使用 + +本仓库主要包含一些关于 LVGL 的学习笔记和示例代码,可以帮助你更好地学习和使用 LVGL。 + +## 贡献 + +欢迎对本仓库进行贡献,可以提交 issue 或者 pull request。 + +## 许可证 + +本项目遵循 MIT 许可证。 \ No newline at end of file -- Gitee