Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): add contentBasePublicPath option #2150

Merged
merged 1 commit into from Dec 5, 2019
Merged

feat(server): add contentBasePublicPath option #2150

merged 1 commit into from Dec 5, 2019

Commits on Dec 4, 2019

  1. feat(server): add contentBasePublicPath option

    Tell 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
    
    facebook/create-react-app#7259
    iamandrewluca committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    cbb5888 View commit details
    Browse the repository at this point in the history