Giter Site home page Giter Site logo

Comments (7)

jhnns avatar jhnns commented on July 23, 2024

The webpack-dev-server works in memory only. There is no need to write something to disk when it's only needed temporarily while you're developing.

from webpack-dev-server.

remoe avatar remoe commented on July 23, 2024

ok, thanks.

from webpack-dev-server.

remoe avatar remoe commented on July 23, 2024

But how can i define a subfolder in the configuration of the devserver to run the following default index.html:

<html>
  <body></body>
  <script src="build/build.js"></script>
  <link rel="stylesheet" media="all" type="text/css" href="build/styles.css">
</html>

?

Currently it only works without a subfolder. I don't want to change my index.html only for the devserver.

from webpack-dev-server.

sokra avatar sokra commented on July 23, 2024

Try to add this to your configuration:

devServer: {
  publicPath: "/build"
}

from webpack-dev-server.

amaschas avatar amaschas commented on July 23, 2024

I think I'm having a similar problem, which I noted in #485. I think one of the big problems here is that the documentation on publicPath is incredibly vague, both in the webpack docs and the webpack-dev-server docs. I'm not sure what exactly I'm supplying a path to, and I've tried many strings for the path, but none of the results in HMR working if contentBase is more than one level below the root dir.

from webpack-dev-server.

jhnns avatar jhnns commented on July 23, 2024

publicPath will be pre-pended to every request when requesting chunks, hot module updates, etc. It should reflect the pathname as seen by the browser (like location.pathname).

from webpack-dev-server.

SpaceK33z avatar SpaceK33z commented on July 23, 2024

Closing because of staleness, and all questions are answered. Feel free to comment if you think otherwise.

from webpack-dev-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.