Test that the template option picks up a loader from the webpack config.

This commit is contained in:
Kees Kluskens 2015-09-06 15:12:59 +02:00 committed by Jan Nicklas
parent 706267961f
commit cfb7e3f01f
1 changed files with 23 additions and 1 deletions

View File

@ -74,7 +74,7 @@ describe('HtmlWebpackPlugin', function() {
}, ['<script src="util_bundle.js"', '<script src="app_bundle.js"'], null, done);
});
it('allows you to use a custom loader', function(done) {
it('allows you to specify a custom loader', function(done) {
testHtmlPlugin({
entry: {
app: path.join(__dirname, 'fixtures/index.js')
@ -91,6 +91,28 @@ describe('HtmlWebpackPlugin', function() {
['<script src="app_bundle.js', 'Some unique text'], null, done);
});
it('uses a custom loader from webpacks config', function(done) {
testHtmlPlugin({
entry: {
app: path.join(__dirname, 'fixtures/index.js')
},
module: {
loaders: [
{test: /\.html$/, loader: 'underscore-template-loader'}
]
},
output: {
path: OUTPUT_DIR,
filename: '[name]_bundle.js'
},
plugins: [new HtmlWebpackPlugin({
inject: false,
template: path.join(__dirname, 'fixtures/underscore.html')
})]
},
['<script src="app_bundle.js', 'Some unique text'], null, done);
});
it('works when using html-loader', function(done) {
testHtmlPlugin({
entry: {