mirror of
https://github.com/discourse/discourse.git
synced 2025-06-15 09:26:10 +08:00
DEV: Pass static scripts through Ember CLI (#17373)
All files under `app/assets/javascripts/scripts` will be run through babel, given sourcemaps, and output under `/assets/{name}.js`. This is another step towards removing our sprockets dependence.
This commit is contained in:
12
app/assets/javascripts/discourse/scripts/browser-detect.js
Normal file
12
app/assets/javascripts/discourse/scripts/browser-detect.js
Normal file
@ -0,0 +1,12 @@
|
||||
if (!window.WeakMap || !window.Promise || typeof globalThis === "undefined") {
|
||||
window.unsupportedBrowser = true;
|
||||
} else {
|
||||
// Some implementations of `WeakMap.prototype.has` do not accept false
|
||||
// values and Ember's `isClassicDecorator` sometimes does that (it only
|
||||
// checks for `null` and `undefined`).
|
||||
try {
|
||||
new WeakMap().has(0);
|
||||
} catch (err) {
|
||||
window.unsupportedBrowser = true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user