Skip to content

Commit c2851f9

Browse files
feat: added support webpackIgnore comment
1 parent 0758b1a commit c2851f9

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

test/fixtures/webpackIgnore.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<img src="image.png" />
2+
<!-- webpackIgnore: true -->
3+
<img src="image.png" />
4+
<!-- webpackIgnore: true --> <img src="image.png" />
5+
<img srcset="image.png 480w 2x broken" src="image.png" alt="Elva dressed as a fairy">
6+
<!-- webpackIgnore: true -->
7+
<img srcset="image.png 480w 2x broken" src="image.png" alt="Elva dressed as a fairy">
8+

test/fixtures/webpackIgnore.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import html from './webpackIgnore.html';
2+
3+
export default html;

test/loader.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,16 @@ describe('loader', () => {
190190
expect(getWarnings(stats)).toMatchSnapshot('warnings');
191191
expect(getErrors(stats)).toMatchSnapshot('errors');
192192
});
193+
194+
// it.only('should work with webpackIgnore comment', async () => {
195+
// const compiler = getCompiler('webpackIgnore.js');
196+
// const stats = await compile(compiler);
197+
//
198+
// expect(getModuleSource('./webpackIgnore.html', stats)).toMatchSnapshot('module');
199+
// expect(
200+
// execute(readAsset('main.bundle.js', compiler, stats))
201+
// ).toMatchSnapshot('result');
202+
// expect(getWarnings(stats)).toMatchSnapshot('warnings');
203+
// expect(getErrors(stats)).toMatchSnapshot('errors');
204+
// });
193205
});

0 commit comments

Comments
 (0)