mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 20:14:39 +00:00
fix: add link rel=preload for exported sites
This commit is contained in:
19
test/apps/export-webpack/test.ts
Normal file
19
test/apps/export-webpack/test.ts
Normal 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);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user