You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the react-juce package that we ship onto npm has a build step for assembling the files into a bundle before distribution. The npm package itself largely just contains a package.json and that bundle.
So far, that's not a problem, but the change I'd like to add here is simple:
Build both a development version (webpack --mode=development) and a production version (webpack --mode=production) bundle
Include both bundles in our npm package
Include a main entrypoint that basically looks like the following
This way we can ship helpful development tools like shims for __BlueprintNative__ and stuff, but only do it within the development bundle, so that we incur no performance penalties (e.g. for excessive use of Proxy) in the prod bundle.
EDIT: I suppose a first step is to answer the question: do we need the intermediate bundle? This project has come a long way since that workflow was first introduced. I wonder if we're now in a position where we could basically just transpile our Typescript/ES6 into the same file structure but as plain ol' ES5 javascript, and ship our npm package that way. That way this original question just disappears, because we can ship if (process.env.NODE_ENV) code in our npm package and end users will automatically compile it out if they bundle in production modes.
The text was updated successfully, but these errors were encountered:
Right now, the
react-juce
package that we ship onto npm has a build step for assembling the files into a bundle before distribution. The npm package itself largely just contains a package.json and that bundle.So far, that's not a problem, but the change I'd like to add here is simple:
webpack --mode=development
) and a production version (webpack --mode=production
) bundleThis way we can ship helpful development tools like shims for
__BlueprintNative__
and stuff, but only do it within the development bundle, so that we incur no performance penalties (e.g. for excessive use of Proxy) in the prod bundle.EDIT: I suppose a first step is to answer the question: do we need the intermediate bundle? This project has come a long way since that workflow was first introduced. I wonder if we're now in a position where we could basically just transpile our Typescript/ES6 into the same file structure but as plain ol' ES5 javascript, and ship our npm package that way. That way this original question just disappears, because we can ship
if (process.env.NODE_ENV)
code in our npm package and end users will automatically compile it out if they bundle in production modes.The text was updated successfully, but these errors were encountered: