Skip to content

Commit

Permalink
fix(build): copy dot files in assets
Browse files Browse the repository at this point in the history
Close #1758
Close #1847
  • Loading branch information
filipesilva committed Aug 26, 2016
1 parent 48a695e commit 8c566ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion addon/ng2/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ export function getWebpackCommonConfig(
}),
new CopyWebpackPlugin([{
context: path.resolve(appRoot, appConfig.assets),
from: '**/*',
from: { glob: '**/*', dot: true },
ignore: [ '.gitignore' ],
to: path.resolve(projectRoot, appConfig.outDir, appConfig.assets)
}])
],
Expand Down
14 changes: 10 additions & 4 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,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
Expand Down

0 comments on commit 8c566ca

Please sign in to comment.