Updated the template export to only show in development mode
This commit is contained in:
Родитель
032e11f859
Коммит
d110e4568d
|
@ -99,21 +99,24 @@ export class MainStore extends BaseStore {
|
|||
|
||||
this.chartStore = new ChartStore(this);
|
||||
|
||||
this.registerExportTemplateTarget(
|
||||
"Charticulator Template",
|
||||
(template: Specification.Template.ChartTemplate) => {
|
||||
return {
|
||||
getProperties: () => [],
|
||||
getFileExtension: () => "json",
|
||||
generate: () => {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const r = btoa(JSON.stringify(template, null, 2));
|
||||
resolve(r);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
// Only enable this if we are in the development environment
|
||||
this.registerExportTemplateTarget(
|
||||
"Charticulator Template",
|
||||
(template: Specification.Template.ChartTemplate) => {
|
||||
return {
|
||||
getProperties: () => [],
|
||||
getFileExtension: () => "json",
|
||||
generate: () => {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const r = btoa(JSON.stringify(template, null, 2));
|
||||
resolve(r);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public saveState(): MainStoreState {
|
||||
|
|
|
@ -11,7 +11,7 @@ const plugins = [
|
|||
buildTimestamp: new Date().getTime(),
|
||||
}),
|
||||
"process.env": {
|
||||
"NODE_ENV": JSON.stringify(process.env.NODE_ENV)
|
||||
"NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development")
|
||||
}
|
||||
})
|
||||
];
|
||||
|
|
Загрузка…
Ссылка в новой задаче