A
A
Alexander2018-03-27 11:03:36
webpack
Alexander, 2018-03-27 11:03:36

How to setup webpack4 proxy and hot reload?

PHP project (prestashop) spinning on the sweet
virtual host , you need to edit the theme files in the sweet/themes/classic-wp4/ folder, the
theme sources are in sweet/themes/classic-wp4/src, the
compiled files are built in sweet/themes/classic-wp4/
there is no separate public folder assets , it works from the root (sweet)
I want to set up a webpack with a soursmap hotreloader,
I can’t figure out the documentation on how to properly configure a proxy
https://webpack.js.org/configuration/dev-server/#d...

module.exports = merge(common, {
    devtool: 'source-map',
    devServer: {
        contentBase: path.resolve(__dirname, '../../..'), // здесь указываю на корень сайта
        stats: 'errors-only',
        hotOnly: true,
         proxy: {
             "../../..": { // здесь вообще не понимаю как правильно?????  указываю на корень сайта
                 target: "http://sweet",
                  secure: false
             }
         },
        public: '.sweet:80'  // ?????
    },
  });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question