Add test case for handling subdirectories in the output path
This commit is contained in:
parent
c10e9336e4
commit
42e8dfa651
1
index.js
1
index.js
|
|
@ -10,7 +10,6 @@ HtmlWebpackPlugin.prototype.apply = function(compiler) {
|
|||
var self = this;
|
||||
compiler.plugin('done', function(stats) {
|
||||
var webpackStatsJson = stats.toJson();
|
||||
console.log(JSON.stringify(webpackStatsJson, null, 2));
|
||||
var templateParams = {};
|
||||
templateParams.webpack = webpackStatsJson;
|
||||
templateParams.htmlWebpackPlugin = self.htmlWebpackPluginJson(compiler, webpackStatsJson);
|
||||
|
|
|
|||
|
|
@ -106,4 +106,28 @@ describe('HtmlWebpackPlugin', function() {
|
|||
}, ['<script src="http://cdn.example.com/assets/index_bundle.js"'], done);
|
||||
});
|
||||
|
||||
it('handles subdirectories in the webpack output bundles', function(done) {
|
||||
testHtmlPlugin({
|
||||
devtool: 'sourcemap',
|
||||
entry: path.join(__dirname, 'fixtures', 'index.js'),
|
||||
output: {
|
||||
path: OUTPUT_DIR,
|
||||
filename: path.join('assets', 'index_bundle.js')
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script src="assets/index_bundle.js"'], done);
|
||||
|
||||
testHtmlPlugin({
|
||||
devtool: 'sourcemap',
|
||||
entry: path.join(__dirname, 'fixtures', 'index.js'),
|
||||
output: {
|
||||
path: OUTPUT_DIR,
|
||||
filename: path.join('assets', 'index_bundle.js'),
|
||||
publicPath: 'http://cdn.example.com/'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script src="http://cdn.example.com/assets/index_bundle.js"'], done);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue