From 0f7134ce380145281afa53b75da70a9989381f03 Mon Sep 17 00:00:00 2001 From: chrisramsey Date: Tue, 29 Mar 2016 20:52:25 -0500 Subject: [PATCH] feat: adds public folder Close #368 --- addon/ng2/blueprints/ng2/files/public/.gitignore | 0 lib/broccoli/angular2-app.js | 5 +++++ tests/e2e/e2e_workflow.spec.js | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 addon/ng2/blueprints/ng2/files/public/.gitignore diff --git a/addon/ng2/blueprints/ng2/files/public/.gitignore b/addon/ng2/blueprints/ng2/files/public/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/broccoli/angular2-app.js b/lib/broccoli/angular2-app.js index 1e3fc27c63..725b62d6b1 100644 --- a/lib/broccoli/angular2-app.js +++ b/lib/broccoli/angular2-app.js @@ -87,10 +87,15 @@ Angular2App.prototype.toTree = function () { destDir: 'vendor' }); + var publicDirTree = new Funnel('public', { + allowEmpty: true + }); + var merged = mergeTrees([ assetTree, tsTree, jsTree, + publicDirTree, this.index(), vendorNpmTree ], { overwrite: true }); diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 21d7c36d5c..bd980e5fee 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -176,6 +176,22 @@ describe('Basic end-to-end Workflow', function () { }); }); + it('moves all files that live inside `public` into `dist`', function () { + this.timeout(420000); + + const tmpFile = path.join(process.cwd(), 'public', 'test.abc'); + const tmpFileLocation = path.join(process.cwd(), 'dist', 'test.abc'); + fs.writeFileSync(tmpFile, 'hello world'); + + return ng(['build', '--silent']) + .then(function () { + expect(existsSync(tmpFileLocation)); + }) + .catch(err => { + throw new Error(err) + }); + }); + it('Turn on `noImplicitAny` in tsconfig.json and rebuild', function (done) { this.timeout(420000);