From 6d984d22601ff40cdc62fd8588c5368a0f6d2fe4 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 26 Aug 2016 02:28:55 +0100 Subject: [PATCH] fix(build): copy dot files in assets --- addon/ng2/models/webpack-build-common.ts | 3 ++- tests/e2e/e2e_workflow.spec.js | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/addon/ng2/models/webpack-build-common.ts b/addon/ng2/models/webpack-build-common.ts index 7bc30b3eef3e..148990df70f3 100644 --- a/addon/ng2/models/webpack-build-common.ts +++ b/addon/ng2/models/webpack-build-common.ts @@ -138,7 +138,8 @@ export function getWebpackCommonConfig(projectRoot: string, environment: string, }), new CopyWebpackPlugin([{ context: path.resolve(appRoot, appConfig.assets), - from: '**/*', + from: { glob: '**/*', dot: true }, + ignore: [ '.gitignore' ], to: path.resolve(projectRoot, appConfig.outDir, appConfig.assets) }]) ], diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index a92ec8cc6501..d79b66ec8b0b 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -313,12 +313,18 @@ describe('Basic end-to-end Workflow', function () { it('moves all files that live inside `assets` into `dist`', function () { this.timeout(420000); - const tmpFile = path.join(process.cwd(), 'src', 'assets', 'test.abc'); - const tmpFileLocation = path.join(process.cwd(), 'dist', 'assets', 'test.abc'); - fs.writeFileSync(tmpFile, 'hello world'); + const dotFile = path.join(process.cwd(), 'src', 'assets', '.file'); + const distDotFile = path.join(process.cwd(), 'dist', 'assets', '.file'); + fs.writeFileSync(dotFile, ''); + const testFile = path.join(process.cwd(), 'src', 'assets', 'test.abc'); + const distTestFile = path.join(process.cwd(), 'dist', 'assets', 'test.abc'); + fs.writeFileSync(testFile, 'hello world'); + const distDotGitIgnore = path.join(process.cwd(), 'dist', 'assets', '.gitignore'); sh.exec(`${ngBin} build`); - expect(existsSync(tmpFileLocation)).to.be.equal(true); + expect(existsSync(dotFile)).to.be.equal(true); + expect(existsSync(builtTestFile)).to.be.equal(true); + expect(existsSync(distDotGitIgnore)).to.be.equal(false); }); // Mobile mode doesn't have styles