diff --git a/generators/app/index.js b/generators/app/index.js index 0ceccf6..4545775 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -92,6 +92,12 @@ module.exports = class extends Generator { { appname: this.appname, gituser: this.gituser } ); + this.fs.copyTpl( + this.templatePath('gitignore'), + this.destinationPath('.gitignore'), + { appname: this.appname, gituser: this.gituser } + ); + let indexName = 'index.jsx'; let storeName = 'store.jsx'; if (this.typescript) { diff --git a/generators/app/templates/gitignore b/generators/app/templates/gitignore new file mode 100644 index 0000000..f1ab330 --- /dev/null +++ b/generators/app/templates/gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.cache/ +.vscode/ \ No newline at end of file diff --git a/test/basic.js b/test/basic.js index 86ecfde..3b53f5c 100644 --- a/test/basic.js +++ b/test/basic.js @@ -11,7 +11,7 @@ describe('generator without everything', function () { }); it('generates a project with react router', () => { - assert.file(['package.json', '.babelrc', 'index.html', 'src/index.jsx']); + assert.file(['package.json', '.babelrc', 'index.html', 'src/index.jsx', '.gitignore']); assert.jsonFileContent('package.json', {"name": "foo"}); assert.noFileContent('src/index.jsx', '../css/app.scss'); assert.noFileContent('src/index.jsx', '');