INNER CODE UNIT · TypeScript

$

tenseijs/tensei · packages/cli/src/BaseCommands/MakePlugin/plugin/server/index.ts:10

class ${className} {
  plugin() {
    ${
      options.withFrontend
        ? `return plugin('${options.name.pascal} Plugin').register(({ script }) => {
      script('${options.name.camel}.js', Path.resolve(__dirname, 'public/app.js'))
    })`
        : `return plugin('${options.name.pascal} Plugin').register(({  }) => {
          
        })`
    }
  }
}

export const ${options.name.camel}Plugin = () => new ${className}()
`,
    location: options?.withFrontend ? 'server/index.ts' : 'src/index.ts',
    sides: ['backend', 'frontend']

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…