ORCID-Source icon indicating copy to clipboard operation
ORCID-Source copied to clipboard

Webpack does not build angular_orcid_generated.js for production

Open jasonbarry opened this issue 6 years ago • 4 comments

https://orcid.org/static/release-1.232.2/javascript/ng1Orcid/angular_orcid_generated.js

Notice all the eval statements and escaped quotes. The file weighs about 8MB.

In the webpack config it appears that the mode is always set to development. I believe calling your build script via CLI like webpack --mode=production will properly minify this file.

See also https://webpack.js.org/guides/production/

jasonbarry avatar Jul 08 '18 03:07 jasonbarry

Thanks @jasonbarry, you're right that web.config.js builds in dev mode, however, we have several different config files that we use for different environments.

The config used in sandbox/prod builds in prod mode and the generated file comes in at ~1.4MB.

The environment can be switched by passing an arg into the Maven command described in orcid-nodejs.

lizkrznarich avatar Jul 09 '18 13:07 lizkrznarich

@lizkrznarich perhaps the env var isn't making its way to production then — I'm seeing the file is 7.96MB on orcid.org.

screen shot 2018-07-09 at 10 39 46 am

jasonbarry avatar Jul 09 '18 17:07 jasonbarry

curl -s https://orcid.org/static/release-1.232.2/javascript/ng1Orcid/angular_orcid_generated.js | grep eval | wc -l produces 875 lines.

rcpeters avatar Jul 09 '18 17:07 rcpeters

#4747

jpeerz avatar Jul 11 '18 00:07 jpeerz

Closing this as very old

TomDemeranville avatar Nov 28 '22 16:11 TomDemeranville