chrisdavies / tlite

A tiny tooltip utility library.
https://chrisdavies.github.io/tlite/
90 stars 19 forks source link

Add Webpack config, Babel and split src and dist files #16

Open qathom opened 6 years ago

qathom commented 6 years ago

Hello @chrisdavies,

Thank you for making tlite! In this PR, I wanted to suggest you to separate source (src/) and production (dist/) files so that it is easier to make tlite in ES6 and work with preprocessors such as Sass. The default output in the webpack.config.js file (libraryTarget) is umd. I runned the tests and it looks fine.

Installation:

npm install
npm run build // generates dist files
npm run test // run tests
chrisdavies commented 6 years ago

First, thanks for using tlite and for putting a pull request together.

I purposely don't use Babel for my library projects, as they almost all initially start off as a "let me see if I can make this small and light-weight" and Babel tends to (or at least it used to) produce unnecessary bloat.

You mention SASS, but I'm not a fan of it. I do think this project (and all of my other ones, for that matter should be using http://cssnext.io/).

I have started using ES5 + Rollup for my newer libraries (see https://github.com/chrisdavies/tiny-date-picker), as it is very effective at producing optimized library output.

Anyway, sorry to be a Debbie downer, but I don't want to bring webpack, babel, or SCSS into this project.

I'd definitely be down with bringing Rollup and cssnext in, though, and changing this to use the more standard /src and /dist layout, though!