Skip to content

Commit ada091c

Browse files
committed
support custom output public path
1 parent 11abcda commit ada091c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class MiniCssExtractPlugin {
333333
'promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {',
334334
Template.indent([
335335
`var href = ${linkHrefPath};`,
336-
`var fullhref = ${mainTemplate.requireFn}.p + href;`,
336+
`var fullhref = ${this.options.outputPublicPath ? `'${this.options.outputPublicPath}'` : `${mainTemplate.requireFn}.p`} + href;`,
337337
'if (fetchRTL) {',
338338
Template.indent([
339339
`fullhref = fullhref.replace(/\\.css/i, '.rtl.css');`,

src/options.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"additionalProperties": true,
33
"properties": {
4+
"globalRTLFlag": {
5+
"type": "string"
6+
},
7+
"outputPublicPath": {
8+
"type": "string"
9+
},
410
"publicPath": {
511
"anyOf": [
612
{
@@ -10,9 +16,6 @@
1016
"instanceof": "Function"
1117
}
1218
]
13-
},
14-
"globalRTLFlag": {
15-
"type": "string"
1619
}
1720
},
1821
"errorMessages": {

test/manual/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
filename: '[name].client.css',
2323
chunkFilename: '[name].chunk.client.css',
2424
globalRTLFlag: 'rtlLanguageEnabled',
25+
// outputPublicPath: '/bundles/css/',
2526
}),
2627
new WebpackRtlPlugin(),
2728
],

0 commit comments

Comments
 (0)