DEV Community

Discussion on: Create react components at the speed of light with Plop.js

Collapse
 
ivanms1 profile image
Ivan

Yeah you can append code to existing file with append action. Something like this

      {
        // Action type 'append' injects a template into an existing file
        type: 'append',
        path: 'src/routes/index.js',
        // Pattern tells plop where in the file to inject the template
        pattern: `/* PLOP_INJECT_IMPORT */`,
        template: `import {{pascalCase name}} from './{{pascalCase name}}';`,
      },
Enter fullscreen mode Exit fullscreen mode
Collapse
 
amirsohel007 profile image
Amir Sohel

but also we need to create router :(

Thread Thread
 
amirsohel007 profile image
Amir Sohel

your linkedin? how can we connect

Thread Thread
 
ivanms1 profile image
Ivan

yeah, let's talk on twitter