ultraq / thymeleafjs

A basic implementation of the Thymeleaf templating engine in JavaScript
Apache License 2.0
52 stars 8 forks source link

Go full ES6 on this project, export a UMD bundle for NPM and Bower #3

Closed ultraq closed 7 years ago

ultraq commented 7 years ago

To support both Bower and NPM ecosystems, a "dist" artifact needs to be created that exports everything from this project via UMD. If that's the case, I might as well go full ES6 on this project and use the much nicer import/export syntax and add build/prepublish steps that generate the files. I'll also need to add either an .npmignore or add an entry to the files section of package.json (preferred so that it has some symmetry with the Bower method) so that only the files I need to publish are published. Similarly for Bower.

ultraq commented 7 years ago

ES6 part done 😄 (was hella fun). Next, the dist artifacts...

panganibanpj commented 7 years ago

Is ./src/Thymeleaf.js the main? I'd like to try this out in my app. I don't see ./lib/Thymeleaf.js (package.json).main

ultraq commented 7 years ago

Yep, ./src/Thymeleaf.js is the main ES6 module, with the intention that ./lib/Thymeleaf.js will be the main CommonJS module which will be generated from the ES6 code and allow use from npm.

If you want to play around with a version while it was still in CommonJS format, then you can use the 0.4.0 version from this repo or npm, rather than the master branch. I haven't published any of the ES6 changes yet, but when I do there will definitely be CommonJS modules for consumption via npm.

ultraq commented 7 years ago

Browser and Node bundles now automatically generated using Rollup.

Again, this is all still development work that will be part of the next version. Existing stuff can be viewed by going to the latest 0.4.0 tag.