Skip to content

Commit 145c036

Browse files
committed
fix(build): copy dot files in assets
1 parent e9ea554 commit 145c036

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

addon/ng2/models/webpack-build-common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ export function getWebpackCommonConfig(projectRoot: string, environment: string,
138138
}),
139139
new CopyWebpackPlugin([{
140140
context: path.resolve(appRoot, appConfig.assets),
141-
from: '**/*',
141+
from: { glob: '**/*', dot: true },
142+
ignore: [ '.gitignore' ],
142143
to: path.resolve(projectRoot, appConfig.outDir, appConfig.assets)
143144
}])
144145
],

tests/e2e/e2e_workflow.spec.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,16 @@ describe('Basic end-to-end Workflow', function () {
313313
it('moves all files that live inside `assets` into `dist`', function () {
314314
this.timeout(420000);
315315

316-
const tmpFile = path.join(process.cwd(), 'src', 'assets', 'test.abc');
317-
const tmpFileLocation = path.join(process.cwd(), 'dist', 'assets', 'test.abc');
318-
fs.writeFileSync(tmpFile, 'hello world');
316+
const dotFile = path.join(process.cwd(), 'src', 'assets', '.file');
317+
const distDotFile = path.join(process.cwd(), 'dist', 'assets', '.file');
318+
fs.writeFileSync(dotFile, '');
319+
const testFile = path.join(process.cwd(), 'src', 'assets', 'test.abc');
320+
const distTestFile = path.join(process.cwd(), 'dist', 'assets', 'test.abc');
321+
fs.writeFileSync(testFile, 'hello world');
319322

320323
sh.exec(`${ngBin} build`);
321-
expect(existsSync(tmpFileLocation)).to.be.equal(true);
324+
expect(existsSync(dotFile)).to.be.equal(true);
325+
expect(existsSync(builtTestFile)).to.be.equal(true);
322326
});
323327

324328
// Mobile mode doesn't have styles

0 commit comments

Comments
 (0)