Uh oh!
There was an error while loading. Please reload this page.
feat(server): add contentBasePublicPath option - #2150
Conversation
|
Codecov Report
@@ Coverage Diff @@## master #2150 +/- ##
==========================================
+ Coverage 93.86% 93.88% +0.01%
==========================================
Files 34 34 Lines 1288 1291 +3 Branches 367 368 +1 ==========================================
+ Hits 1209 1212 +3
Misses 78 78 Partials 1 1
Continue to review full report at Codecov.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alexander-akait
left a comment
There was a problem hiding this comment.
Please provide repo example with use case
alexander-akait
commented
Jul 24, 2019
Also you need accept CLA |
Uh oh!
There was an error while loading. Please reload this page.
unrevised6419
commented
Jul 24, 2019
I signed CLA! |
https://github.com/iamandrewluca/plsdelete-wds-use-case Set |
alexander-akait
commented
Jul 25, 2019
sounds confused, you want handle static and public directory from one directory, but it is not good idea, why not use |
for example in create-react-app, you can set env In this issue is described the use case with example |
as I know |
alexander-akait
commented
Jul 25, 2019
Maybe |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
unrevised6419
commented
Jul 25, 2019
Now I'm strugling with settings |
alexander-akait
commented
Jul 25, 2019
For example: handle |
In my app I set |
Use |
I think we misunderstood each other. /home/me/project/assets/
manifest.json{contentBase: '/home/me/project/assets/',contentBasePublicPath: '/url-path',} |
alexander-akait
commented
Jul 25, 2019
oh, i see 👍 |
unrevised6419
commented
Jul 29, 2019
@evilebottnawi is there any reason why |
alexander-akait
commented
Jul 29, 2019
Because we should handle only |
alexander-akait
commented
Nov 29, 2019
@Flydiverny in my todo, next week will be new release, we need help here #2313 for release |
alexander-akait
commented
Dec 4, 2019
/cc @hiroppy can you look at this, i want to merge and do new release |
Uh oh!
There was an error while loading. Please reload this page.
cd96602Tell the server at what URL to serve `devServer.contentBase`. If there was a file `assets/manifest.json`, it would be served at `/serve-content-base-at-this-url/manifest.json`
__webpack.config.js__
```javascript
module.exports = {
//...
devServer: {
contentBase: path.join(__dirname, 'assets'),
contentBasePublicPath: '/serve-content-base-at-this-url'
}
};
```
Now `webpack-dev-server` serves static files (`contentBase`) from root ignoring `publicPath`
Using added option we can serve static files from `publicPath`
This use case is needed in create-react-app, when want to serve all files from `publicPath`
doesn't matter in development or production
react/create-react-app#7259unrevised6419
commented
Dec 4, 2019
@hiroppy it's done! |
alexander-akait
commented
Dec 5, 2019
Sorry for big delay, we really have very many issues and very few developers |
unrevised6419
commented
Dec 5, 2019
raix
commented
Dec 5, 2019
Thank you :) |

contentBasePublicPathexample webpack.js.org#3291Tell the server at what URL to serve
devServer.contentBase. If there was a fileassets/manifest.json, it would be served at/serve-content-base-at-this-url/manifest.jsonwebpack.config.js
Motivation / Use-Case
Now
webpack-dev-serverserves static files (contentBase) from root ignoringpublicPathUsing added option we can serve static files from
publicPathThis use case is needed in create-react-app, when want to serve all files from
publicPathdoesn't matter in development or production
https://github.com/iamandrewluca/plsdelete-wds-use-caseAbove repo will be deleted because does not reflect current changes after review.
From start the option was intended to be
contentBasePrependPublic: booleanBreaking Changes
No breaking changes
Related
react/create-react-app#7259
react/create-react-app#6135
react/create-react-app#6280