Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 7eb8803

Browse files
committed
[update] pass filtering unwanted files
1 parent 0e17c6e commit 7eb8803

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

test/spec.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ describe('PreloadPlugin filters chunks', function() {
375375
});
376376
});
377377

378-
describe('PreloadPlugin preloads all assets', function() {
378+
// describe('PreloadPlugin preloads all assets', function() {
379379
// it('adds preload tags', function(done) {
380380
// const compiler = webpack({
381381
// entry: path.join(__dirname, 'fixtures', 'load-css.js'),
@@ -432,36 +432,36 @@ describe('PreloadPlugin preloads all assets', function() {
432432
// });
433433
// });
434434

435-
// describe('filtering unwanted files', function() {
436-
// it('does not include map files to be preloaded', function(done) {
437-
// const compiler = webpack({
438-
// entry: {
439-
// js: path.join(__dirname, 'fixtures', 'file.js')
440-
// },
441-
// output: {
442-
// path: OUTPUT_DIR,
443-
// filename: 'bundle.js',
444-
// chunkFilename: 'chunk.[chunkhash].js',
445-
// publicPath: '/',
446-
// },
447-
// devtool: 'cheap-source-map',
448-
// plugins: [
449-
// new HtmlWebpackPlugin(),
450-
// new PreloadPlugin()
451-
// ]
452-
// }, function(err, result) {
453-
// expect(err).toBeFalsy();
454-
// expect(JSON.stringify(result.compilation.errors)).toBe('[]');
455-
// const html = result.compilation.assets['index.html'].source();
456-
// expect(html).toContain('<link rel="preload" as="script" href="/chunk.');
457-
// expect(html).not.toContain('.map"');
458-
// done();
459-
// });
460-
// compiler.outputFileSystem = new MemoryFileSystem();
461-
// });
462-
// });
435+
describe('filtering unwanted files', function() {
436+
it('does not include map files to be preloaded', function(done) {
437+
const compiler = webpack({
438+
entry: {
439+
js: path.join(__dirname, 'fixtures', 'file.js')
440+
},
441+
output: {
442+
path: OUTPUT_DIR,
443+
filename: 'bundle.js',
444+
chunkFilename: 'chunk.[chunkhash].js',
445+
publicPath: '/',
446+
},
447+
devtool: 'cheap-source-map',
448+
plugins: [
449+
new HtmlWebpackPlugin(),
450+
new PreloadPlugin()
451+
]
452+
}, function(err, result) {
453+
expect(err).toBeFalsy();
454+
expect(JSON.stringify(result.compilation.errors)).toBe('[]');
455+
const html = result.compilation.assets['index.html'].source();
456+
expect(html).toContain('<link rel="preload" as="script" href="/chunk.');
457+
expect(html).not.toContain('.map"');
458+
done();
459+
});
460+
compiler.outputFileSystem = new MemoryFileSystem();
461+
});
462+
});
463463

464-
// describe('multiple html', function() {
464+
describe('multiple html', function() {
465465
// it('each one only include their own chunk', function(done) {
466466
// const compiler = webpack({
467467
// entry: {

0 commit comments

Comments
 (0)