Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

How to use this plugin with webpack-dev-server #66

Open
4lph4-Ph4un opened this issue Mar 28, 2018 · 1 comment
Open

How to use this plugin with webpack-dev-server #66

4lph4-Ph4un opened this issue Mar 28, 2018 · 1 comment
Labels
needmore Need more information

Comments

@4lph4-Ph4un
Copy link

4lph4-Ph4un commented Mar 28, 2018

Hi!

I'm wondering how to use this plugin with webpack-dev-server? I get this to work beautifully when applying production builds using webpack -p build command, but when I try to use this with dev-server, the client will not naturally find the output js-file (hence -it's not actually produced in server-mode)

Here's my current plugins and their settings:

plugins: [ 
  new BundleAnalyzerPlugin(),
  new ServiceWorkerWebpackPlugin({
    entry:    `${APP_DIR}/service-worker.js`,
    filename: "../service-worker.js",
    excludes: [ "**/.*", "**/*.map", "*.html" ],
   })
  new webpack.NamedModulesPlugin(), // Named Modules for DEV:
  new webpack.HotModuleReplacementPlugin(),
  new webpack.optimize.CommonsChunkPlugin({
    name: [ "vendor", "polyfills" ]
  }),
  new HtmlWebpackPlugin({
    filename: 	       "../index.html",
    title:             "Learning Diary Project",
    template:          `${APP_DIR}/index.ejs`,
    alwaysWriteToDisk: true
  }),
  new HtmlWebpackHarddiskPlugin(),
 ]
@woutervanvliet woutervanvliet added the needmore Need more information label Apr 19, 2018
@woutervanvliet
Copy link
Collaborator

Would you be able to setup a repo that reproduces the issue with the least amount of code necessary?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needmore Need more information
Projects
None yet
Development

No branches or pull requests

2 participants