For reference how is const howLongTillLunch = require('..') working?
iannazzi opened this issue · 2 comments
iannazzi commented
I am assuming
const howLongTillLunch = require('..');
reads package.json
and pulls
dist/how-long-till-lunch.umd.js
from browser
Can someone confirm?
MariusMeiners commented
from my understanding no. Require should load the cjs version and not the umd one. From what i understand umd is supposed to be served to unpkg or another cdn. And its intended to be used with a <script src="...">
eventualbuddha commented
For nodejs require('..')
will read package.json
and read the file specified by main
.