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

fixWebpackChunksIssue() does not work with custom bundle names #145

Open
maxmilton opened this issue Feb 19, 2018 · 3 comments
Open

fixWebpackChunksIssue() does not work with custom bundle names #145

maxmilton opened this issue Feb 19, 2018 · 3 comments
Labels

Comments

@maxmilton
Copy link

Going off discussion in #142 (comment) I'm openning a dedicated issue for this.

I'm currently implementing my own logic for removing <script> tags webpack injects at runtime because it causes an async race condition.

I did see the fixWebpackChunksIssue function which would probably solve the same issue, however, the bundle name regex' are hardcoded and my bundle names are different so they don't get handled by fixWebpackChunksIssue().

Being able to customise the names might be a possible solution. This might be related to #144 since it would probably be necessary to pass a RegExp in the config.

@stereobooster
Copy link
Owner

How your Webpack chunk names look like?

@maxmilton
Copy link
Author

Sorry, I got caught up in an important client project for a while.

In the specific case where I ran into this issue, the relevant part of my webpack config is:

output: {
    path: config.build.assetsRoot,
    filename: utils.assetsPath('js/[name].[chunkhash:7].js'),
    chunkFilename: utils.assetsPath('js/[id].[chunkhash:7].js'),
    // chunkFilename: utils.assetsPath('js/[name].[chunkhash:7].js'), // for some projects or debugging
    jsonpFunction: '$$', // default "webpackJsonp" is too long
  },

I've also worked with other webpack setups where the file naming scheme was completely different.

Is there maybe some way to extract the file names from webpack? That way any name may be possible.

@stereobooster
Copy link
Owner

I wonder if there exists some setting in Webpack, like this in HtmlWebpackPlugin

// Ensure chunks are evaluated in correct order
chunksSortMode: 'dependency'

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

No branches or pull requests

3 participants
@stereobooster @maxmilton and others