koca / vue-prism-editor

A dead simple code editor with syntax highlighting and line numbers. 3kb/gz
https://prism-editor.netlify.com
MIT License
751 stars 84 forks source link

Compiling with vitejs breaks due to reliance on Node's `global` #110

Closed wagslane closed 3 years ago

wagslane commented 3 years ago

This is a front-end library, it shouldn't rely on Node built-ins.

Error: vue-router.esm.js:2314 ReferenceError: global is not defined

Found at:

const isWindows = 'navigator' in global && /Win/i.test(navigator.platform);
const isMacLike = 'navigator' in global && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
wagslane commented 3 years ago

Looks like this was resolved here