Plop File Templates for Visual Studio CodeInstall the extension on the VSCode Marketplace FeaturesThis extension adds single and multi-file templates to Visual Studio Code.
Add a template by right clicking the desired location and selecting Creating new project item from templateTo invoke template selection, simply right click on a folder or file in vscode file explorer and click the Extension Setup
ProTip: Add plop templates as a recommended extension to your
|
Title | Description | Default Value |
---|---|---|
configFileName | File name or path to plop file | plopfile.js at root of workspace |
terminalName | Name of the Terminal window created for plop | terminalName |
plopCommand | By default this extension assumes plop is installed globally (npm install -g plop ).If you'd like to use a local version of plop you can do so by adding "add-form-template": "plop" to your "scripts" record in your package.json .Example: "scripts": { "add-from-template": "plop" } Next update the plopCommand setting with your command name (in the example above "add-from-template") |
plop |
destinationPath | Name of the prompt the destination path will be passed in as | destinationpath |
Using a local version of plop
This extension expects plop.js to be install globally using npm install plop -g
if you do not want to do this you can use a local version by doing the following
Install plop for the current project by running
npm install --save-dev plop
In your
package.json
file underscripts
add a newplop-script
script.
{
// rest of your package.json file...
"scripts": {
"plop-script": "plop", // this tells the extension to use this projects version of plop
},
// rest of your package.json file...
}
Go to
File
→Preferences
→Settings
→ Search forplopTemplates
Edit the "Plop Command" setting to your script name from step 3. In the example above we used
plop-script
Resolving common issues
Cannot find module ...\node_modules\plop\src\plop.js'
- You need to install plop globally, do so by running the following
npm install -g plop
- Alternatively you can install plop for just the current project
- You need to install plop globally, do so by running the following
The term 'plop' is not recognized as the name of a cmdlet, function, script file, or operable program...
- You need to install plop globally, do so by running the following
npm install -g plop
- Alternatively you can install plop for just the current project
- You need to install plop globally, do so by running the following
Couldn't load plop config file at the path: ".../plopfile.js" - ENOENT: no such file or directory, stat '...\plopfile.js'
- You need to create a plopfile with generators. Please see Extension Setup
Release Notes
1.2.0
- Plop 3.1.1 or higher required
- Removed shipped plop dependency
- Removed shipped handlebars dependency
- Reduced size from 7,200KB --> 54KB
- Reduced load time
1.1.0
- Fixing bug caused in 1.0.5 causing
MODULE_NOT_FOUND
error - Updated plop to latest version (2.7.4) and node-plop (0.26.2)
1.0.5
- Documentation updates
1.0.4
- Skip 'destinationpathName' parameter automatically (thanks @rbadapanda)
1.0.3
- Added destinationpath command
1.0.2
- Fixed command naming
- Added link to vscode marketplace
- Added issues link
- Added plopCommand setting
1.0.0
- Initial release