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

Static build names #874

Closed
Happy-Ferret opened this issue Mar 17, 2018 · 2 comments
Closed

Static build names #874

Happy-Ferret opened this issue Mar 17, 2018 · 2 comments
Labels

Comments

@Happy-Ferret
Copy link

Curious.

Is there a way to pre-define file names for the two .js files generated by the styleguide build process?

Currently, those files appear to be "versioned". In my case the names are bundle.a538a71f.js and 0.4a3876a7.js respectively.

I'd appreciate being able to change them to bundle.js and 0.js.

I use React Styleguidist in combination with Docusaurus and need to add the paths to both these files manually, to the template.

@sapegin
Copy link
Member

sapegin commented Mar 19, 2018

They are defined here:

filename: 'build/bundle.[chunkhash:8].js',
chunkFilename: 'build/[name].[chunkhash:8].js',

You'll have to use dangerouslyUpdateWebpackConfig option to change them: https://react-styleguidist.js.org/docs/configuration#dangerouslyupdatewebpackconfig

@catamphetamine
Copy link

catamphetamine commented Oct 3, 2018

So, the solution is:

	dangerouslyUpdateWebpackConfig(webpackConfig, env) {
		webpackConfig.output.filename = 'build/bundle.js'
		webpackConfig.output.chunkFilename = 'build/[name].js'
		return webpackConfig
	}

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