davidmarkclements / rfdc

Really Fast Deep Clone
MIT License
643 stars 25 forks source link

Add rollup to build libruary. #2

Closed OperKH closed 5 years ago

OperKH commented 5 years ago

Also:

To make build just run npm run build it will create ./dist folder with 3 types of modules.

Rollup config checks eslint, transpiles ES6+ code to ES5 and uglifies code.

Without build modules I can't use this lib in my project because libraries should be distributed as ES5 code to not break compatibility with <IE11 and because we are always do not compile node_modules code.

Before this PR I saw const in my vendors.js file.

davidmarkclements commented 5 years ago
  • Add .editorconfig.

I'm not totally against adding this, but I'm also not that interested in it – But I agree with @BridgeAR it should be a separate PR

  • Add .prettierrc to be able quick format w/o brakiong es-lint rules.

This projects uses standard, (see devDependencies) - use standard --fix to reformat

  • Add .eslintrc.js to get rid of vars.

why? there's nothing wrong with using vars

  • Move "./index.js" to "./src/index.js".

To make build just run npm run build it will create ./dist folder with 3 types of modules.

Rollup config checks eslint, transpiles ES6+ code to ES5 and uglifies code.

Without build modules I can't use this lib in my project because libraries should be distributed as ES5 code to not break compatibility with <IE11 and because we are always do not compile node_modules code.

Before this PR I saw const in my vendors.js file.

I would rather convert all code to ES5 manually than introduce transpilation overhead.

OperKH commented 5 years ago

Build is more convenient for front-end projects:

  1. Code already minified
  2. Code 100% supported by IE11 (ES5)
  3. It's able to use any type of modules, so it adds support of any bundle system on front-end projects.