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..43af48519d86 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(distDotFile)).to.be.equal(true); + expect(existsSync(distTestFile)).to.be.equal(true); + expect(existsSync(distDotGitIgnore)).to.be.equal(false); }); // Mobile mode doesn't have styles