Support relative urls on windows (#205)
This commit is contained in:
parent
453975ee0f
commit
63e4ad6fc7
2
index.js
2
index.js
|
|
@ -380,7 +380,7 @@ HtmlWebpackPlugin.prototype.htmlWebpackPluginAssets = function (compilation, chu
|
|||
var css = chunkFiles.filter(function (chunkFile) {
|
||||
// Some chunks may contain content hash in their names, for ex. 'main.css?1e7cac4e4d8b52fd5ccd2541146ef03f'.
|
||||
// We must proper handle such cases, so we use regexp testing here
|
||||
return /^.css($|\?)/.test(path.extname(chunkFile));
|
||||
return /.css($|\?)/.test(chunkFile);
|
||||
});
|
||||
assets.chunks[chunkName].css = css;
|
||||
assets.css = assets.css.concat(css);
|
||||
|
|
|
|||
|
|
@ -356,6 +356,27 @@ describe('HtmlWebpackPlugin', function () {
|
|||
}, ['<link href="styles.css"'], null, done);
|
||||
});
|
||||
|
||||
it('should work with the css extract plugin on windows and protocol relative urls support (#205)', function (done) {
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
testHtmlPlugin({
|
||||
entry: path.join(__dirname, 'fixtures/theme.js'),
|
||||
output: {
|
||||
path: OUTPUT_DIR,
|
||||
filename: 'index_bundle.js',
|
||||
publicPath: '//localhost:8080/'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin(),
|
||||
new ExtractTextPlugin('styles.css')
|
||||
]
|
||||
}, ['<link href="//localhost:8080/styles.css"'], null, done);
|
||||
});
|
||||
|
||||
it('should allow to add cache hashes to with the css assets', function (done) {
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
testHtmlPlugin({
|
||||
|
|
|
|||
Loading…
Reference in New Issue