Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Add ES-browser build #880

Closed
mario-aleo opened this issue Dec 1, 2020 · 2 comments
Closed

Add ES-browser build #880

mario-aleo opened this issue Dec 1, 2020 · 2 comments

Comments

@mario-aleo
Copy link

mario-aleo commented Dec 1, 2020

Problem

Every build option that we have has the process validation, so if you try to import tippy.js to a project that is built for modern browsers and so it doesn't have a building step, it's going to fail because process is not defined at validation.ts:46.

Solution

It would be nice to have a .mjs output that does not transpile ES2015+ code and removes all references to process by assuming it is in a production environment.
This approach has been done at Redux reduxjs/redux#3143 and, as stated there by Tim, is similar to the one of Vue vuejs/vue#7110.

@atomiks
Copy link
Owner

atomiks commented Dec 10, 2020

Are you able to create a PR?

Also, can't you polyfill process in the browser? This would allow you to retain the warning messages which are helpful when using the lib, although the file size remains large with the warnings I suppose. You could also use the UMD version instead.

@atomiks atomiks closed this as completed Feb 22, 2021
@IanVS
Copy link

IanVS commented Aug 3, 2021

This would be great. The ES build could also use import.meta.env instead of process.env to be compatible with modern build tools like astro, snowpack, and vite, and I believe webpack 5 too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants