codeBelt / generate-template-files

A simple generator to create custom template files for any application
https://medium.com/@robertsavian/generate-template-files-with-ease-19b320615359
MIT License
209 stars 31 forks source link

More control on dynamic output path #4

Closed JimSchofield closed 5 years ago

JimSchofield commented 5 years ago

Could we give more control to a dynamic output path, something along the lines of webpack?

i.e.

outputPath: './assets/src/~blockname~(lowerCase)/~blockname~(lowerCase)',
codeBelt commented 5 years ago

We should talk this one out but I was planning on adding some customer functions. See '(something)': () => 'pass in text',

{
    option: "Create Ngrx Store",
    templatesPath: './tools/templates/ngrx/',
    stringReplacers: ['~Component~', '~Model~'],
    caseTypes: {
        default: '(pascalCase)',
        defaultOutputPath: '(kebabCase)',
        custom: {
            '(something)': () => 'pass in text',
        }
    },
    outputPath: './dest/app/stores/~Component~(lowerCase)',
},