question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run build without any minification

See original GitHub issue

Is this a bug report?

Not really.

Suggestion

I saw https://github.com/facebook/create-react-app/issues/3448 by @Xopsy and unfortunately this has been closed. However, I do have a legitimate use case for it.

So my suggestion is: Provide a way to e.g. pass --dev or so to npm run build, so I can get a build output in the same way as I get when running npm start, i.e. unminified.

Background

I’ve fairly documented that background in https://stackoverflow.com/questions/55165466/how-to-build-a-production-version-of-react-without-minification (and this question) already, so I’ll make it short: In browser add-ons (WebExtensions) minification is nearly useless as it is saved offline and can even cause problems, as inline JavaScript is included.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
heyimalexcommented, Mar 15, 2019

Heh, you should have mentioned csp issues. This should solve your problem:

INLINE_RUNTIME_CHUNK=false npm run build
0reactions
rugkcommented, Mar 15, 2019

I’ve linked to it all over the place 😉

But, yes, awesome! That solves my use case totally!

So, @heyimalex, if you want, feel free to submit this as an answer to https://stackoverflow.com/questions/55160698/how-to-use-react-without-unsafe-inline-javascript-css-code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to build a production version of React without minification?
npm run build built unobfuscated, readable code that ran as expected, using no other modifications. Used Gitbash only with the commands npm ...
Read more >
react-scripts-plugin-no-minify - npm
Plugin to disable minification for Create React App. Latest version: 0.4.0, last published: 4 years ago. Start using ...
Read more >
How to Not Minify Source with webpack - David Walsh Blog
I think the way is to create two separate files, one for dev and one for production building. Then attach them to package.json...
Read more >
Tutorial: How to Minify & Version a JS File with NPM Scripts
Minify your script.js file as script.min.js; Add the new version number and build time to the header of your script.min.
Read more >
npm run build does not minify bundles #9458 | Support Center
As you can see below, "npm run build" executes correctly with no errors, but the created bundles are identical to the dev versions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found