create-plasmic-app 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/templates/gatsby.js
CHANGED
|
@@ -150,6 +150,27 @@ const HeadComponents = [
|
|
|
150
150
|
key="plasmic-preamble"
|
|
151
151
|
src="https://static1.plasmic.app/preamble.js"
|
|
152
152
|
/>,
|
|
153
|
+
<script
|
|
154
|
+
key="plasmic-hmr"
|
|
155
|
+
type="text/javascript"
|
|
156
|
+
dangerouslySetInnerHTML={{
|
|
157
|
+
__html: \`
|
|
158
|
+
if (typeof window !== "undefined" && /\\\\/plasmic-host\\\\/?$/.test(window.location.pathname)) {
|
|
159
|
+
const RealEventSource = window.EventSource;
|
|
160
|
+
window.EventSource = function(url, config) {
|
|
161
|
+
if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {
|
|
162
|
+
console.warn("Plasmic: disabled EventSource request for", url);
|
|
163
|
+
return {
|
|
164
|
+
onerror() {}, onmessage() {}, onopen() {}, close() {}
|
|
165
|
+
};
|
|
166
|
+
} else {
|
|
167
|
+
return new RealEventSource(url, config);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
\`,
|
|
172
|
+
}}
|
|
173
|
+
/>
|
|
153
174
|
]
|
|
154
175
|
|
|
155
176
|
const isProduction = process.env.NODE_ENV === "production"
|
package/package.json
CHANGED
package/src/templates/gatsby.ts
CHANGED
|
@@ -167,6 +167,27 @@ const HeadComponents = [
|
|
|
167
167
|
key="plasmic-preamble"
|
|
168
168
|
src="https://static1.plasmic.app/preamble.js"
|
|
169
169
|
/>,
|
|
170
|
+
<script
|
|
171
|
+
key="plasmic-hmr"
|
|
172
|
+
type="text/javascript"
|
|
173
|
+
dangerouslySetInnerHTML={{
|
|
174
|
+
__html: \`
|
|
175
|
+
if (typeof window !== "undefined" && /\\\\/plasmic-host\\\\/?$/.test(window.location.pathname)) {
|
|
176
|
+
const RealEventSource = window.EventSource;
|
|
177
|
+
window.EventSource = function(url, config) {
|
|
178
|
+
if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {
|
|
179
|
+
console.warn("Plasmic: disabled EventSource request for", url);
|
|
180
|
+
return {
|
|
181
|
+
onerror() {}, onmessage() {}, onopen() {}, close() {}
|
|
182
|
+
};
|
|
183
|
+
} else {
|
|
184
|
+
return new RealEventSource(url, config);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
\`,
|
|
189
|
+
}}
|
|
190
|
+
/>
|
|
170
191
|
]
|
|
171
192
|
|
|
172
193
|
const isProduction = process.env.NODE_ENV === "production"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|