Skip to content

Commit f4f5464

Browse files
committed
feature: adds public folder
1 parent 8b6e80c commit f4f5464

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

addon/ng2/blueprints/ng2/files/public/.gitignore

Whitespace-only changes.

lib/broccoli/angular2-app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,15 @@ Angular2App.prototype.toTree = function () {
8787
destDir: 'vendor'
8888
});
8989

90+
var publicDirTree = new Funnel('public', {
91+
allowEmpty: true
92+
});
93+
9094
var merged = mergeTrees([
9195
assetTree,
9296
tsTree,
9397
jsTree,
98+
publicDirTree,
9499
this.index(),
95100
vendorNpmTree
96101
], { overwrite: true });

tests/e2e/e2e_workflow.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ describe('Basic end-to-end Workflow', function () {
176176
});
177177
});
178178

179+
180+
it('moves all files that live inside `public` into `dist`', function () {
181+
this.timeout(420000);
182+
183+
const tmpFile = path.join(process.cwd(), 'public', 'test.abc');
184+
const tmpFileLocation = path.join(process.cwd(), 'dist', 'test.abc');
185+
fs.writeFileSync(tmpFile, 'hello world');
186+
187+
return ng(['build', '--silent'])
188+
.then(function () {
189+
expect(existsSync(tmpFileLocation));
190+
})
191+
.catch(err => {
192+
throw new Error(err)
193+
});
194+
});
195+
179196
it('Turn on `noImplicitAny` in tsconfig.json and rebuild', function (done) {
180197
this.timeout(420000);
181198

0 commit comments

Comments
 (0)