Test that the template option picks up a loader from the webpack config.
This commit is contained in:
parent
706267961f
commit
cfb7e3f01f
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue