# FrontEnd Installation
# Folder & Main Class creation
- Pick a name for your module (lower_case)
- Go to
/modulesand create a folder with the name of your module - Create a Js file with your module name inside the new folder
/modules/module_example/module_example.js - Create your Module class by extending the
ModuleBaseclass
import ModuleBase from "@/modules_loader/ModuleBase";
class Module_example extends ModuleBase {
name = "module_example";
cartTypes = [
"CUSTOM_ITEM_TYPE",
];
init(context, app) {
this.ctx = context;
this.app = app;
//To enable/disable the module without socket Data
this.enabled = false;
}
loadSocket(socketOn, context) {
//To enable/disable the module with socket Data
socketOn("module_example_activation", async (data) => {
this.enabled = data;
});
}
}
export default Module_example;
# Importing the Module
To load a module it shouuld be loaded in two places, The folder structure wich is managed by LightMerger, and in the runtime by the NuxtJs app.
Example of loading the
module_exampleModule in/plugins/modules.js:import modules from "@/modules_loader/modules_loader"; import module_example from "@/module_example"; modules.load(module_example); export default ({ app }, inject) => { inject('modules', modules); }Example of loading the
module_exampleModule in/light-merger.json:"merges": [ { "path": "@" }, { "path": "@/modules/pcv_v1" }, { "path": "@/modules/module_example" } ],