Skip to content

Commit 48e5581

Browse files
authored
Merge pull request #81 from Open-STEM/FranksDev
Add /public if it is local
2 parents 6d715ab + 923a1f7 commit 48e5581

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/managers/pluginmgr.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ export default class PluginMgr {
187187
* Load plugin blocks from a JSON file
188188
*/
189189
private async loadPluginBlocks(blocksUrl: string): Promise<PluginBlock[] | null> {
190+
191+
if (process.env.NODE_ENV === 'development') {
192+
blocksUrl = '/public' + blocksUrl;
193+
}
194+
190195
try {
191196
const response = await fetch(blocksUrl);
192197
if (!response.ok) {
@@ -238,7 +243,7 @@ export default class PluginMgr {
238243
);
239244

240245
if (controlBoardCategory) {
241-
const colorLEDBlock = await this.loadPluginBlocks('/public/plugins/2350/nonbeta_blocks.json');
246+
const colorLEDBlock = await this.loadPluginBlocks('/plugins/2350/nonbeta_blocks.json');
242247
controlBoardCategory.contents.push(colorLEDBlock);
243248
}
244249

0 commit comments

Comments
 (0)