Skip to content

Commit 8c566ca

Browse files
committed
fix(build): copy dot files in assets
Close #1758 Close #1847
1 parent 48a695e commit 8c566ca

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export function getWebpackCommonConfig(
147147
}),
148148
new CopyWebpackPlugin([{
149149
context: path.resolve(appRoot, appConfig.assets),
150-
from: '**/*',
150+
from: { glob: '**/*', dot: true },
151+
ignore: [ '.gitignore' ],
151152
to: path.resolve(projectRoot, appConfig.outDir, appConfig.assets)
152153
}])
153154
],

tests/e2e/e2e_workflow.spec.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,18 @@ describe('Basic end-to-end Workflow', function () {
316316
it('moves all files that live inside `assets` into `dist`', function () {
317317
this.timeout(420000);
318318

319-
const tmpFile = path.join(process.cwd(), 'src', 'assets', 'test.abc');
320-
const tmpFileLocation = path.join(process.cwd(), 'dist', 'assets', 'test.abc');
321-
fs.writeFileSync(tmpFile, 'hello world');
319+
const dotFile = path.join(process.cwd(), 'src', 'assets', '.file');
320+
const distDotFile = path.join(process.cwd(), 'dist', 'assets', '.file');
321+
fs.writeFileSync(dotFile, '');
322+
const testFile = path.join(process.cwd(), 'src', 'assets', 'test.abc');
323+
const distTestFile = path.join(process.cwd(), 'dist', 'assets', 'test.abc');
324+
fs.writeFileSync(testFile, 'hello world');
325+
const distDotGitIgnore = path.join(process.cwd(), 'dist', 'assets', '.gitignore');
322326

323327
sh.exec(`${ngBin} build`);
324-
expect(existsSync(tmpFileLocation)).to.be.equal(true);
328+
expect(existsSync(distDotFile)).to.be.equal(true);
329+
expect(existsSync(distTestFile)).to.be.equal(true);
330+
expect(existsSync(distDotGitIgnore)).to.be.equal(false);
325331
});
326332

327333
// Mobile mode doesn't have styles

0 commit comments

Comments
 (0)