Closed gmaclennan closed 7 years ago
Now intended to publish ES5 artifacts (es5/*
, transpiled with babel) suitable for require()
/ import
.
For posterity, the source of the initial symptom was that browserify
was correctly bundling everything (including React, which would have led to further problems down the line). It stubbed out require()
, so including mapfilter.js
in a <script>
tag worked. However, when used in an environment where require()
actually existed (such as an environment built with browserify
or just plain node
), it would defer to that. babel-runtime/helpers/defineProperty.js
does a relative require of ../core-js/object/define-property
, which fails to resolve appropriately in the new environment.
derequire
addresses the relative require
problem, but then there were [app-specific] CSS inlining problems.
@gmaclennan:
If/when we do, for people that like script tags, https://www.bram.us/2016/08/04/distributing-your-react-component-as-a-standalone-version/ is what we need.
(build:js
will likely get us partway there)
Trying to build and package for publishing npm.
Right now the packaged version does not work without babelify, gives the following error:
We a single export from this module when it is published to npm: The React Component
<MapFilter>
that works without babel or anything else.