Closed nazar-pc closed 7 years ago
Also depends on #117
It's done this way for people using seamless-immutable
on Node: it respects Node's production flag automatically, whereas in the browser you can load whichever is appropriate.
What about to add another key browser
to package.json
with seamless-immutable.production.min.js
in it so that it would be possible to find deterministically which file browser should use?
I've added similar key to Redux already (https://github.com/reactjs/redux/pull/2047), quote from there:
There was a key
browser
in jQuery'spackage.json
in past, so I decided that this is a good candidate to use.I'm currently checking following keys (based on
package.json
files of other popular projects) with priority from higher to lower:
- browser
- jspm.main
- main
As a side note, would be nice to have some more common structure for production builds, like dist/seamless-immutable.js
(production version) and dist/seamless-immutable.min.js
(production minified version).
As a side note, would be nice to have some more common structure for production builds, like dist/seamless-immutable.js (production version) and dist/seamless-immutable.min.js (production minified version).
We already have that, except it's at the project root rather than in a dist/
folder. 🙂
Arguably a dist
folder would be a slightly better place to put them, but I don't think that slight improvement is worth breaking everyone's builds the next time they upgrade.
Arguably a dist folder would be a slightly better place to put them, but I don't think that slight improvement is worth breaking everyone's builds the next time they upgrade.
There are 2 ways here, neither of which is perfect:
dist/{seamless-immutable.js|seamless-immutable.min.js}
(sounds awful)The third option is sticking with the status quo, which seems to have the fewest downsides.
Closing this as #177 was merged, which solves issue for me.
Do you have plans to release a new version anytime soon?
Nice, I see new release already:)
In my framework I have a convenient feature that allows to automatically call AMD modules with RequireJS by their name. For instance, after
seamless-immutable
installation I am able to dorequire(['seamless-immutable '], ...)
anywhere in my app and it just works.In order for above feature to work I'm using different keys from both
bower.json
andpackage.json
in order to determine which file should be used by RequireJS to map package name alias there.However, currently
package.json
for whatever reason points to source instead of production version. Moreover, it causes an errorReferenceError: process is not defined at makeImmutable
on this line.What is the idea behind this decision and could it be changed to production file in next releases?