azimutlabs / rollup Goto Github PK
View Code? Open in Web Editor NEW๐ฃ Rollup configurations for the best package bundling experience
Home Page: https://alabs.team/en
License: MIT License
๐ฃ Rollup configurations for the best package bundling experience
Home Page: https://alabs.team/en
License: MIT License
Current rollup-config-typescript
uses @rollup/plugin-typescript
which is a standalone solution that bundles js as well as type declarations, but for most of the cases, in development, we don't need to have type declarations. The output from the plugin is overwritten by babel
too. We have to consider creating our own rollup-plugin-typescript
for cases where only type check and declaration file output is needed.
Currently rollup does not allow us to make dynamic imports of configs from workspace, that is why it is required for now to use rollup config in packages using CommonJS
to be able to use them with collect
. Any ideas of how to make dynamic imports work with rollup using esm
The output directory could contain unwanted files inside depending on the context and compilation time, so it's suggested to have some output clean-up mechanism.
Examples should contain:
Describe the bug
fromWorkspaces
returns an empty array when packages in the workspace have not declared one another in their dependencies at all.
To Reproduce
Have a mono-repo workspace with two separate packages A
and B
. Calling fromWorskpaces
from the root of the mono-repo will result in an empty array.
Expected behavior
Array with alphabetic order of rollup configuration glob patterns
Desktop (please complete the following information):
v0.1.2
Esbuild is a rapidly growing and extremely fast JavaScript bundler that would be perfect for some small projects or even some big ones for a better watch
mode optimization.
Describe the bug
Collect
does not import configs from workspace dynamically
To Reproduce
Steps to reproduce the behavior:
collect
, which will collect configs from workspacesExpected behavior
Collection of rollup configs from workspaces
Describe the bug
useWorkspaces
from @azimutlabs/rollup
is mistaken as react-hook by eslint-plugin-react-hooks
To Reproduce
Lint rollup.config.js
file using eslint-plugin-react-hooks and enabled rules-of-hooks
rule.
Is your feature request related to a problem? Please describe.
collect
requires you to have a rollup.config.js in every single package, but sometimes packages have an orderly simple, and repetitive configuration files.
Describe the solution you'd like
A function in @azimutlabs/rollup
that would populate one configuration depending on the given glob pattern.
Use case example would be:
// Root of the mono-repo
// rollup.config.js
import { fromWorkspaces, populate } from '@azimutlabs/rollup';
import { compose } from '@azimutlabs/rollup-config';
import { babel } from '@azimutlabs/rollup-config-babel';
export default populate(
// Will consider every directories matching glob pattern `ui.*` under a `packages` directory a rollup workspaces.
// (requires valid `src` directory and package.json to sort the compile order using dependency graph)
['packages/ui.*', babel('es')],
['examples/*', babel('cjs')],
);
Describe alternatives you've considered
We could give #41 more thoughts and stick to 1 package = 1 config
.
Is your feature request related to a problem? Please describe.
The final rollup configuration lacks any source map generation options.
Describe the solution you'd like
Add source map options to rollup output.
The function should get the nearest package.json and search for the workspaces
field to get patterns from there. Expected usage:
import { collect, useWorkspaces } from '@azimutlabs/rollup';
export default collect(useWorkspaces());
Describe the bug
rollup-config-babel
can't find the configuration file when using with collect
To Reproduce
Use collect
in another directory that does not contain .babelrc
and create a package with .babelrc
(containing @babel/preset-typescript
) and rollup.config.js
that contains rollup-config-babel
. Add sample src/index.ts
with TypeScript only code, like export type Alias = string;
Expected behavior
TypeScript transpiled to javascript
Desktop (please complete the following information):
0.2.2
Is your feature request related to a problem? Please describe.
Jest requires transformers to compile TypeScript or JSX code, but our rollup configurations already handle this process.
Describe the solution you'd like
Integrate rollup
with jest
by creating rollup-jest
transformer.
Describe the bug
If no lib directory exists, config compiles packages in alphabetical order, which causes error if one of the dependencies, that should be compiled first, is at the end of alphabetical order.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All packages are compiled successfully in correct order
To support absolute path imports it's best to implement it using @rollup/plugin-alias
inside of our essentials
configuration. It would be really helpful for complex packages and developers could forget about using other tools like module-resolver
plugin for babel.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.