hannahhoward / a1atscript

The Angular 2 Polyfill
MIT License
101 stars 7 forks source link

Clean up project, add webpack as build tool #26

Closed lily-mara closed 9 years ago

lily-mara commented 9 years ago

First, we cleaned the project (we felt that the .DS_Store files and .idea folder were unnessecary) and we removed the dist/ folder as it just contains a copy of everything in the src folder. We added a postInstall hook with npm that builds a bundle directly from the source that is exported as the main entrypoint. We used webpack for this because of the greatly simplified api over gulp. The functionality that is currently available from gulp tasks should be encapsulated by the npm scripts npm run build and npm test.

hannahhoward commented 9 years ago

Hey! Thanks for your help! I definitely agree about removing .idea and DS_STORE files. I need to give switching all to webpack a bit more thought -- looking forward, I lean toward evolving more towards supporting System.js / system-js-builder (and potentially JSPM) as that's in line with the ES6 spec. I will admit I have less experience with webpack than either browserify or systemjs -- but still I'd be inclined to offer it as an option rather than the default. Among other things currently A1AtScript has to continue supporting traceur so pure ES6 files need to remain part of the solution -- I guess this could be done by importing directly from src/. Also dist/ currently offers a requirejs bundle and a node ES5 bundle as well as the source files. Anyway, I'll give it some thought. In the mean time, I'll go ahead and remove the .idea + .DS_Store files from master. Thanks!

ronnross commented 9 years ago

I kind of agree with @natemara. I don't think one should be running their dependencies (node_modules) through their build tools. I like your idea of having an ES5 version available in the dist folder and having folks just using the src folder if they want to include it in their build step. The current issue with the ES5 file is that it requires Traceur, I use Babel and have run into trouble. So I have to keep a local copy of the repo that build to es5 without the Traceur depencies. Kind of a pain since I just can't pull it down from npm. Your thoughts?

hannahhoward commented 9 years ago

Alright I'm good to remove the src files from dist and just leave them in source. However, I'd rather do the webpack/ES5 build ahead of time and put it in a dist folder than build it in the post install hook -- so we can removed the added dependencies. I'm not super sophisticated with node packages, but can't the build be done in a pre-publish step?

hannahhoward commented 9 years ago

Made a few small changes but otherwise this was merged. Let me know if this will work for you.