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
{{ message }}
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
The following should be incorporated into the output JS of compiled Elm files.
(function(){varElm= ... // current emitted code goes hereif(typeofdefine==="function"&&define.amd){define([],function(){returnElm;});}elseif(typeofmodule==="object"){module.exports=Elm;}else{if(typeofthis.Elm==="undefined"){this.Elm=Elm;}else{thrownewError("This page is trying to import multiple compiled Elm programs using the same `Elm` global object, which would cause conflicts. This can be resolved by using a module loader like RequireJS to import the compiled Elm programs into different objects.")}}}).call(this);
PREVIOUS VERSION:
This version is more "stock" and will silently overwrite any previous Elm globals defined on the page...which seems far less desirable than crashing early with a helpful message.
(function(){varElm= ... // current emitted code goes hereif(typeofdefine==="function"&&define.amd){define([],function(){returnElm;});}elseif(typeofmodule==="object"){module.exports=Elm;}else{this.Elm=Elm;}}).call(this);
The text was updated successfully, but these errors were encountered:
Just updated the original description to handle a case we ran into: if you add multiple compiled Elm programs to the same page, bad things will happen. The updated snippet will now:
See elm/compiler#1029 for discussion that led to this.
The following should be incorporated into the output JS of compiled Elm files.
PREVIOUS VERSION:
This version is more "stock" and will silently overwrite any previous
Elm
globals defined on the page...which seems far less desirable than crashing early with a helpful message.The text was updated successfully, but these errors were encountered: