Primeng: Feature request: Use NPM's scope packages

Created on 19 May 2016  路  5Comments  路  Source: primefaces/primeng

It would be convenient to be able to install a single feature by using NPM's scope packages, a bit like angular did with their modules.

So this:
npm install primeng
would become:
npm install @primeng/calendar

Most helpful comment

We'll consider this when there are more requests, however I think if you import the module name instead of PrimeNG, you'll have a smaller bundle using the following convention;

import {ComponentModule} from 'primeng/components/componentname/componentname';

try;

import {AccordionModule} from 'primeng/components/accordion/accordion';

Convention is:

instead of ;

import {AccordionModule} from 'primeng/primeng';

So your bundle will just have accordion instead of other PrimeNG modules.

All 5 comments

+1

Can this be added to the V2 milestone? Would help reduce bundle sizes for most apps. Also reduces risk upgrading one component without having to retest all other components.

Using https://chrisbateman.github.io/webpack-visualizer/ - primeng is 696kb (raw), for comparison @angular/core is 367.9kb. For my app, I only need to use 3 primeng components, totaling 90kb. primeng has a large number of components to choose from (which is great!!) but it would be great if we could only reference the ones that are used within our app.

We'll consider this when there are more requests, however I think if you import the module name instead of PrimeNG, you'll have a smaller bundle using the following convention;

import {ComponentModule} from 'primeng/components/componentname/componentname';

try;

import {AccordionModule} from 'primeng/components/accordion/accordion';

Convention is:

instead of ;

import {AccordionModule} from 'primeng/primeng';

So your bundle will just have accordion instead of other PrimeNG modules.

That reduces the bundle size massively, thanks! Docs should use that convention instead of the full import so everyone gets a smaller bundle by default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

just-paja picture just-paja  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

mitosandov picture mitosandov  路  3Comments

papiroca-tm picture papiroca-tm  路  3Comments