commenthol / date-holidays-parser

parser for worldwide holidays
ISC License
46 stars 22 forks source link

Including in Angular causing commonjs warnings #49

Closed Gillardo closed 2 years ago

Gillardo commented 2 years ago

Can the project be updated to support Es2020, or at least ES2015 so packaging of the code can take advantage of tree shaking.

You get warning like this atm

image

My tsconfig file looks like so

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "../../out-tsc/app",
    "types": [],
    "module": "esnext",
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ]
}

My route tsconfig looks like so

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2020",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ]
  }
}
commenthol commented 2 years ago

Hi @Gillardo, the project uses ES2020 at ist core. Additional CJS is offered via rollup. So both options are provided via package.json exports. As I am not into Angular, I urge you to check your config first. If you then think that this project does requires changes, please file a PR.