fix(frontend): add style tag to head in html output (#1638)

fix #1623
This commit is contained in:
Jason Jean 2019-07-26 09:01:38 -04:00 committed by GitHub
parent 1b2eaf81fe
commit 89b522d2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -125,6 +125,12 @@ forEachCli(() => {
filesToCheck.push(`dist/apps/${appName}/styles.css`); filesToCheck.push(`dist/apps/${appName}/styles.css`);
} }
checkFilesExist(...filesToCheck); checkFilesExist(...filesToCheck);
if (opts.checkStyles) {
expect(readFile(`dist/apps/${appName}/index.html`)).toContain(
`<link rel="stylesheet" href="styles.css">`
);
}
const testResults = await runCLIAsync(`test ${appName}`); const testResults = await runCLIAsync(`test ${appName}`);
expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total'); expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total');
const lintE2eResults = runCLI(`lint ${appName}-e2e`); const lintE2eResults = runCLI(`lint ${appName}-e2e`);

View File

@ -49,6 +49,9 @@ forEachCli(() => {
`dist/apps/${appName}/main-es5.js`, `dist/apps/${appName}/main-es5.js`,
`dist/apps/${appName}/styles.css` `dist/apps/${appName}/styles.css`
); );
expect(readFile(`dist/apps/${appName}/index.html`)).toContain(
`<link rel="stylesheet" href="styles.css">`
);
const testResults = await runCLIAsync(`test ${appName}`); const testResults = await runCLIAsync(`test ${appName}`);
expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total'); expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total');
const lintE2eResults = runCLI(`lint ${appName}-e2e`); const lintE2eResults = runCLI(`lint ${appName}-e2e`);

View File

@ -105,6 +105,9 @@ export function run(
normalize(context.workspaceRoot), normalize(context.workspaceRoot),
options.index options.index
), ),
files: result1.emittedFiles.filter(
x => x.extension === '.css'
),
noModuleFiles: result2.emittedFiles, noModuleFiles: result2.emittedFiles,
moduleFiles: result1.emittedFiles, moduleFiles: result1.emittedFiles,
baseHref: options.baseHref, baseHref: options.baseHref,