Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run renderer when webpack in watch mode #34

Open
Feverqwe opened this issue Apr 26, 2019 · 1 comment
Open

Don't run renderer when webpack in watch mode #34

Feverqwe opened this issue Apr 26, 2019 · 1 comment

Comments

@Feverqwe
Copy link

Feverqwe commented Apr 26, 2019

Hello! I use something like

<div id="root">{{prerender:./src/AppPrerender}}</div>

And when I change something, HtmlWebpackPlugin don't run renderer.

Now I fix it with simple loader (source code)
And use:

{
  module: {
    rules: [
      {
        test: /[\\/]src[\\/]templates[\\/]index\.html$/,
        use: [{
          loader: path.resolve('./builder/cacheDependencyLoader.js'),
          options: {
            dependencies: [
              path.resolve('./src/AppPrerender')
            ]
          }
        }, {
          loader: 'prerender-loader',
          options: {
            string: true
          }
        }]
      },
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: './src/templates/index.html'
    }),
  ],
  ...
}
@Feverqwe Feverqwe changed the title Not run renderer when webpack in watch mode Don't run renderer when webpack in watch mode Apr 26, 2019
@devrelm
Copy link

devrelm commented Oct 25, 2019

Looks like this would actually be fixed via #39?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants