Giter Site home page Giter Site logo

azimutlabs / rollup Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 72.77 MB

๐Ÿฃ Rollup configurations for the best package bundling experience

Home Page: https://alabs.team/en

License: MIT License

TypeScript 99.63% JavaScript 0.06% Shell 0.31%
rollup rollup-config alabs azimutlabs rollup-plugin rollup-configurations

rollup's People

Contributors

iamnurs avatar olehan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rollup's Issues

Consider creating `rollup-plugin-typescript`

Motivation

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.

Usage of dynamic imports in `collect`

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

Cleanup `outputDir` on start

Motivation

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.

`fromWorkspaces` returns an empty array

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):

  • OS: MacOS BigSur
  • Version v0.1.2

Add rollup-config-esbuild

Motivation

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.

dynamic imports do not work with collect

Describe the bug
Collect does not import configs from workspace dynamically

To Reproduce
Steps to reproduce the behavior:

  1. Create rollup config from root with collect, which will collect configs from workspaces
  2. See error

Expected behavior
Collection of rollup configs from workspaces

Populate one configuration depending on the given glob pattern

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.

Add source maps to the output

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.

Add `useWorkspaces` function for `rollup` package

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());

`rollup-config-babel` can't find the configuration file when using with `collect`

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):

  • OS: MacOS Big Sur
  • Version 0.2.2

Add `rollup-jest`

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.

Config compiles dependencies in alphabetical order

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:

  1. Remove lib directory from packages
  2. Run rollup compile command
  3. See error

Expected behavior
All packages are compiled successfully in correct order

Add `@rollup/plugin-alias` to `essentials`

Motivation

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.