sandoche / Jekyll-webpack-boilerplate

⚡️ A boilerplate with Jekyll and Webpack to make the most performant static websites
MIT License
188 stars 57 forks source link

Support for `_src/template/default.html` compiling to `_layouts/default.html` in development server #27

Open kmotoko opened 4 years ago

kmotoko commented 4 years ago

In reference to the issue #9 , I found a boolean setting for webpack-dev-server which enables writing the changed files to disk. You just need to add writeToDisk: true to the devServer part in webpack.dev.js:

  devServer: {
    contentBase: [
      path.resolve('_site'),
    ],
    hot: true,
    writeToDisk: true,
  },

The docs for the relevant option is here: https://webpack.js.org/configuration/dev-server/#devserverwritetodisk-

sandoche commented 4 years ago

@kmotoko did this work for you? I tried locally and it does not work for me. Maybe because I had t odowngrade webpack-dev-server. Can you do a PR with your working configuration?

I got the following:

[0] - configuration has an unknown property 'writeToDisk'. These properties are valid: [0] object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, clientLogLevel?, overlay?, progress?, key?, cert?, ca?, pfx?, pfxPassphrase?, requestCert?, inline?, disableHostCheck?, public?, https?, contentBase?, watchContentBase?, open?, useLocalIp?, openPage?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, before?, after?, stats?, reporter?, reportTime?, noInfo?, quiet?, serverSideRender?, index?, log?, warn? }