Điểm qua fabricjs/babel-plugin-transform-imports: 0 sao trên GitHub. Fork from https://bitbucket.org/amctheatres/babel-transform-imports
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
import { Row, Grid as MyGrid } from 'react-bootstrap';
import { merge } from 'lodash';
...into default style imports:
import Row from 'react-bootstrap/lib/Row';
import MyGrid from 'react-bootstrap/lib/Grid';
import merge from 'lodash/merge';
Note: this plugin is not restricted to the react-bootstrap and lodash
libraries. You may use it with any library.
Why?
When Babel encounters a member style import such as:
import { Grid, Row, Col } from 'react-bootstrap';
it will generate something similarish to:
var reactBootstrap = require('react-bootstrap');
var Grid = reactBootstrap.Grid;
var Row = reactBootstrap.Row;
var Col = reactBootstrap.Col;
Which causes the entire library to be loaded, even though only some components
are needed. Some libraries are rather large and pulling in the entire module
would cause unnecessary bloat to your client optimized (webpack etc.) bundle.
The only way around this is to use default style imports:
import Grid from 'react-bootstrap/lib/Grid';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';
But, the more pieces we need, the more this sucks. This plugin will allow you
to pull in just the pieces you need, without a separate import for each item.
Additionally, it can be configured to throw when somebody accidentally writes
an import which would cause the entire module to resolve, such as:
import Bootstrap, { Grid } from 'react-bootstrap';
// -- or --
import * as Bootstrap from 'react-bootstrap';
Sometimes, you may wish to use regular expressions in your transformation (for
example, to enforce the same convention in all folder levels on the structure
of your library).
import { MyModule } from 'my-library';
import { App } from 'my-library/components';
import { Header, Footer } from 'my-library/components/App';
to become:
import MyModule from 'my-library/MyModule';
import App from 'my-library/components/App';
import Header from 'my-library/components/App/Header';
import Footer from 'my-library/components/App/Footer';
Using a function as the transformer
If you need more advanced or more specific transformation logic, and are using
Babel 7+ with a .babelrc.js file, you may provide a function instead of a
string for the transform option:
If you need the above flexibility of using a function as a transformer, but
are still on Babel 6 or cannot use a .babelrc.js file for some reason, you
may provide a path to a .js file which exports a function to run instead.
Keep in mind that the .js file will be required relative from this plugin's
path, likely located in /node_modules/babel-plugin-transform-imports. You
may provide any filename, as long as it ends with .js.
If you need to import style file along with js file, you may set transformStyle option.
It will generate import with side effects, like "import 'ant-design-vue/lib/date-picker/style';"
The transformStyle is just like transform, can be string or function. And you can set it to array of string or function, it will generate import with side effects statements as more as the length of the array.
The library name to use instead of the one specified in the import statement. ${member} will be replaced with the import name, aka Grid/Row/Col/etc., and ${1-n} will be replaced by any matched regular expression groups. Alternatively, pass a path to a .js file which exports a function to process the transform, which is invoked with parameters: (importName, matches). If using Babel 7+, a function may be passed directly. (see Advanced Transformations)
preventFullImport
boolean
no
false
Whether or not to throw when an import is encountered which would cause the entire module to be imported.
memberConverter
string or function
no
undefined
Convertor for the import name, could be one of 'camel','pascal','kebab','snake', or a function of type (importName: string) => string . When is valid, runs ${member} through it.
skipDefaultConversion
boolean
no
false
When set to true, will preserve import { X } syntax instead of converting to import X.
transformStyle
string or function or array
no
undefined
Act just like 'transform', but the results will be one or more "import 'source/result';"
Đọc thêm về fabricjs/babel-plugin-transform-imports ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/fabricjs/babel-plugin-transform-imports là nguồn chính thức.
fabricjs/babel-plugin-transform-imports có bao nhiêu sao?
fabricjs/babel-plugin-transform-imports có 0 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/fabricjs/babel-plugin-transform-imports. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
fabricjs/babel-plugin-transform-imports có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho fabricjs/babel-plugin-transform-imports. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
fabricjs/babel-plugin-transform-imports có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho fabricjs/babel-plugin-transform-imports. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
fabricjs/babel-plugin-transform-imports có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho fabricjs/babel-plugin-transform-imports. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
fabricjs/babel-plugin-transform-imports còn đang phát triển không?
Commit gần nhất trên fabricjs/babel-plugin-transform-imports là 3.3 năm trước (theo timestamp GitHub). Repo có 0 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
babel-plugin-transform-imports có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về babel-plugin-transform-imports.