harpreetkhalsagtbit / country-state-city

Basic library for Country, State and City
country-state-city.vercel.app
GNU General Public License v3.0
277 stars 179 forks source link

Angular warnings because of commonjs #81

Open Gidmark opened 2 years ago

Gidmark commented 2 years ago

When building with Angular you get this warnings:

my-file.ts depends on 'country-state-city'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I suggest that you have a ES version as well since at the moment the generated js will include Cities even though I only import Countries and States:

import { Country, State } from "country-state-city";
Gidmark commented 2 years ago

See https://github.com/harpreetkhalsagtbit/country-state-city/pull/82

harpreetkhalsagtbit commented 2 years ago

Next.js with Production Build

  1. with - import {Country, State, City} from 'country-state-city Screen Shot 2022-08-20 at 4 02 46 AM

  2. with - import { Country } from 'country-state-city Screen Shot 2022-08-20 at 4 04 55 AM

@Gidmark