fix: add link rel=preload for exported sites

This commit is contained in:
Nolan Lawson
2019-02-15 23:52:30 -08:00
parent 82e637ea7c
commit 351ab13d29
17 changed files with 358 additions and 30 deletions

View File

@@ -0,0 +1,19 @@
import * as assert from 'assert';
import * as api from '../../../api';
import * as fs from 'fs';
describe('export-webpack', function() {
this.timeout(10000);
// hooks
before(async () => {
await api.build({ cwd: __dirname, bundler: 'webpack' });
await api.export({ cwd: __dirname, bundler: 'webpack' });
});
it('injects <link rel=preload> tags', () => {
const index = fs.readFileSync(`${__dirname}/__sapper__/export/index.html`, 'utf8');
assert.ok(/rel=preload/, index);
});
});