How do you sync webpack + Open Server local?



  • Please indicate if there is any way to synchronize the work of the Open Server files with the Webpack. For the project to be audited during npm start, to be able to access webpack but to read PHP and OBD. It didn't work out by devServer. I don't know how to build a proxy. But I found a useful question here. https://ru.stackoverflow.com/questions/933319/webpack-dev-server-%D0%BA%D0%B0%D0%BA-%D1%81%D0%BE%D0%B2%D0%BC%D0%B5%D1%81%D1%82%D0%B8%D1%82%D1%8C-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D1%81-open-server It's talking about an additional BrowserSync. Now it turns out that with the npm start, I've got everything loaded (php,db) and the address is given from the Webpack, but it doesn't see the dist/build folder (which will be a project in the future) The whole question is. How do we start translating the unpacked dist?

      devServer: {
    historyApiFallback: true,
    contentBase: paths.build,
    open: true,
    compress: true,
    watchContentBase: true,
    port: 3000,
    

    plugins: [

      new BrowserSyncPlugin(
          {
              host: 'localhost',
              port: 3000,
              proxy: 'http://ссылка на адрес проекта Open server.ru/',
              files: [
                  {
                      match: ['./src'],
                      fn(event, file) {
                          if (event === 'change') {
                              const bs = require('browser-sync').get('bs-webpack-plugin');
                              bs.reload();
                          }
                      },
                  },
              ],
          },
          {
              reload: false,
          }
      ),
    

    ] ♪



  • It is likely that the addition of constructions may be used. https://webpack.js.org/configuration/dev-server/#devserverproxy For a desserve, without a brwsersync. It's about how to make it the brwsersync from Open Server, it's been a long time since a separate one. https://www.youtube.com/watch?v=wE-Oi84UJXE but there's a Gupl front assembly.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2