gajus / isomorphic-webpack

Abstracts universal consumption of application code base using webpack.
Other
291 stars 17 forks source link

webpack output.filename not in-sync with actual bundle filename #18

Closed tyler-dot-earth closed 7 years ago

tyler-dot-earth commented 7 years ago

Still unraveling this little mystery, but here's the gist of it:

  output: {
    path: path.resolve(__dirname, '../public/built'),
-   filename: '[name].bundle.js', // DOESN'T WORK
    publicPath: '/public/', // as it will be served
    chunkFilename: '[name]-[chunkhash].js',
  },
  output: {
    path: path.resolve(__dirname, '../public/built'),
+   filename: '[name].js', // WORKS
    publicPath: '/public/', // as it will be served
    chunkFilename: '[name]-[chunkhash].js',
  },

I discovered this after I was having a hard time getting rid of this error:

<project>/node_modules/isomorphic-webpack/dist/factories/createCompilerCallback.js:90
      throw new Error('Bundle file does not exist.');

Which led me to add some console.log-ing to see that absoluteEntryBundleName in factories/createCompilerCallback.js wasn't the same as the actual bundle name (it lacked the .bundle bit in the middle).

Not sure what the exact cause of this is (haven't tested to see if output.filename can be used in the demo app like I was using it here -- could be my not-so-straightforward webpack config ... maybe my server-side html rendering which also loops through bundles to add <script /> links)

cryptiklemur commented 7 years ago

Any update on this? Would really love to be able to use [name].[chunkhash:8].js