Skip to content
Permalink
Browse files

prevent source code provisioning in release build (#1067)

* prevent source code provisioning in release build

* Update webpack.config.prod.js
  • Loading branch information...
neilyoung authored and tannerlinsley committed Mar 13, 2019
1 parent 6ed6cdf commit d1852e44454a57869a1b1b17a412ed44856148dd
Showing with 2 additions and 2 deletions.
  1. +2 −2 packages/react-static/src/static/webpack/webpack.config.prod.js
@@ -87,7 +87,7 @@ function common(config) {
cache: true,
parallel: true,
exclude: /\.min\.js/,
sourceMap: true,
sourceMap: false,
terserOptions: {
ie8: false,
mangle: { safari10: true },
@@ -125,7 +125,7 @@ function common(config) {
new CaseSensitivePathsPlugin(),
config.bundleAnalyzer && new BundleAnalyzerPlugin(),
].filter(d => d),
devtool: 'source-map',
devtool: false,
}
}

7 comments on commit d1852e4

@neilyoung

This comment has been minimized.

Copy link
Contributor Author

neilyoung replied Mar 14, 2019

@tannerlinsley Could you briefly update me, what the status is? I have lost the track.
Today I must have updated my running project. At least now I again have source code on the web.

While skimming through the webpack.conf I found this:

  }), !isNode && !process.env.REACT_STATIC_DEBUG && new _webpack2.default.optimize.UglifyJsPlugin({
      sourceMap: config.generateSourceMaps
    }),

in node_modules/react-static/lib/static/webpack/webpack.config.prod.js

Could you please shed some light? What is this config.blabla

This back and forth is constantly breaking my projects and sucks a bit

@tannerlinsley

This comment has been minimized.

Copy link
Collaborator

tannerlinsley replied Mar 14, 2019

We haven't published a release with your changes yet. There haven't been any other release either, so I'm not sure what would be causing you to go back and forth.

We're planning a release as soon as possible. There's a lot in this next one too, so we're trying to make sure it doesn't break anyone and is as seamless as possible.

@neilyoung

This comment has been minimized.

Copy link
Contributor Author

neilyoung replied Mar 14, 2019

Thanks for the quick answer. But I don't remember to have seen this "config.generatedSourceMaps" in my PR... So where does it come from? I remember to have followed an update request today (I reported on another thread), where I was asked to update react-static from 5.9.12 to 6.9.3. Did that. After that I found this in the react-static/lib..../config.prod.js
Strange...

I patched it again and now sources are gone again, but whoooo

@tannerlinsley

This comment has been minimized.

Copy link
Collaborator

tannerlinsley replied Mar 14, 2019

I'm not sure where that's coming from tbh, but as you can see, master has your changes and they are slated for release. https://github.com/nozzle/react-static/blob/master/packages/react-static/src/static/webpack/webpack.config.prod.js#L90-L128

@neilyoung

This comment has been minimized.

Copy link
Contributor Author

neilyoung replied Mar 14, 2019

I see, and I have checked it too.... Scary :)

@tannerlinsley

This comment has been minimized.

Copy link
Collaborator

tannerlinsley replied Mar 14, 2019

This may be what you're seeing: Before the move to Terser instead of Uglify, there could possibly have been some options that were regressively removed, that being one of them. Regardless, your changes will still take effect.

@neilyoung

This comment has been minimized.

Copy link
Contributor Author

neilyoung replied Mar 14, 2019

Please sign in to comment.
You can’t perform that action at this time.