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

ResetDevSite doesn't produce export-bundle.js #5120

Closed
donker opened this issue May 11, 2022 · 1 comment
Closed

ResetDevSite doesn't produce export-bundle.js #5120

donker opened this issue May 11, 2022 · 1 comment

Comments

@donker
Copy link
Contributor

donker commented May 11, 2022

Description of bug

When building your local dev site the resulting website does not include export-bundle.js or any of the other react projects and as a result the PersonaBar doesn't work.

Analysis

From a Slack discussion about this issue:

I figured out why the build was not generating the yarn js products on his local dev site. Hold on to your seat, here we go:

  • When DNN runs a build it passes through AEModule.build MSBuild script which calls “yarn run build”
  • This fires off lerna from the root package.json as “lerna run build --stream”
  • This then goes to each JS project listed in that package.json and finds their package.json and runs the “build” script
  • E.g. Sites.Web will have this “set NODE_ENV=production&&webpack -p”
  • Now the webpack.config.js for that project is loaded and you’ll find it attempts to establish mode as follows: const isProduction = process.env.NODE_ENV === “production”;
  • This is where things go wrong. It turns out this is not set to production by the command and now isProduction is false
  • The output path looks at whether we are in production mode or not and if not then we see if we have a local settings file. If you are a DNN developer, you will have one. This will then be used for output. Meaning that a proper production output path is not used but the development path.

I am not sure how we got here. I also cannot explain why NODE_ENV does not persist to the webpack config. I also cannot explain what if anything changed. I did not experience any issues because I still had (old) local copies in place which were being used.

Affected version

We can't establish how long this problem has persisted.

@david-poindexter
Copy link
Contributor

Closing per #5121 - thanks again @donker 🎉

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

No branches or pull requests

2 participants