Closed vvasuki closed 5 years ago
To be honest, I just use webpack in all of my projects which works well for Gray Matter.
Maybe @jonschlinkert knows of a public example of using Gray Matter that @vvasuki could look at for inspiration.
To clarify - when I install the package with npm, I just want to be able to include use the library as in the below cases:
<script src="{{ relURL "node_modules/jquery/dist/jquery.min.js" }}"></script>
<script src="{{ relURL "node_modules/jquery-csv/src/jquery.csv.min.js" }}"></script>
<script src="{{ relURL "node_modules/jquery-ui-dist/jquery-ui.min.js" }}"></script>
<script src="{{ relURL "node_modules/bootstrap/dist/js/bootstrap.min.js" }}"></script>
<script src="{{ relURL "node_modules/@sanskrit-coders/sanscript/sanscript.js" }}"></script>
<script src="{{ relURL "node_modules/showdown/dist/showdown.js" }}"></script>
I don't like bundling all the js-s into a single bundle.js (seems to make debugging harder).
I don't like bundling all the js-s into a single bundle.js (seems to make debugging harder).
I think it might be a better idea to work out how to debug bundled code (via .map files) than to perform all of the manual labour with script includes.
I don't think this is a problem with this library; more with your use case. I'm going to close this as won't fix. If you want to package this library into a single JS file for your own use cases you should be able to use the browserify docs to do that.
In my latter packages, I also parcel-ify browser.js
, to be able to auto-distribute to unpkg -- https://dev.to/patarapolw/npm-repo-with-pure-browser-version-and-also-with-tests-and-linting-28jo
@vvasuki Parcel is an effortless bundler, unlike Webpack.
// browser.js
import matter from 'gray-matter'
Object.assign(window, { matter })
Then, parcel build browser.js
. Here you go, parcel'd version.
most of the modules I've installed as a js novice come with files ready to use in web browsers. I find it hard to figure out how to browserify this. Perhaps you could distribute this library that way as well or provide instructions for how to browserify it on the README?