M
M
Mikhail2019-03-03 15:23:20
Python
Mikhail, 2019-03-03 15:23:20

How to make webpack automatically write to a file instead of memory?

The webpack server keeps the output in memory, but how is that memory referenced? from a flask, for example, or how to make it automatically write changes to the hard disk instead of memory?

module.exports = {
 entry:{
  app: './src/start.js'
 },
 output: {
  filename:'[name].js',
  path: '/var/www/localhost/htdocs/test1.ru/apps/static/site/dist',
  publicPath: '/dist'
 },
 module: {
        rules: [
            {
                test: /\.html$/,
                loader: "underscore-template-loader",
                query: {
                    engine: 'lodash',
                }
            },
        ]
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kositsyn, 2019-03-03
@alex_keysi

Don't use webpack server. Download nginx and configure it to look in the dist folder. And then you reload the page and the new code is downloaded. And webpack itself will collect the diff in dist when saved in ide.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question