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

Build is unstable when project is build in a different path #2028

Closed
mvorisek opened this issue Feb 22, 2023 · 4 comments · Fixed by #2040 or atk4/ui#2045
Closed

Build is unstable when project is build in a different path #2028

mvorisek opened this issue Feb 22, 2023 · 4 comments · Fixed by #2040 or atk4/ui#2045

Comments

@mvorisek
Copy link
Contributor

https://github.com/atk4/ui/blob/dedb4cea3191e45ba2334ad48c0f98c6d25edf32/.github/workflows/test-unit.yml#L344 hack is needed to make babel build stable, otherwise a variable name in the resulting build is containing the resolved local path, making the build unstable

how to reproduce:

  1. checkout https://github.com/atk4/ui
  2. cd into js/ dir
  3. run npm install (without the patch from above applied) and npm run build
  4. notice the git changes in ../public/js dir containing a local path
@mvorisek
Copy link
Contributor Author

mvorisek commented May 5, 2023

@alexander-akait do you have an idea how to fix it or is a webpack issue instead?

@alexander-akait
Copy link

alexander-akait commented May 5, 2023

Oh, missed your issue (not sure how it happens), give me time to look

@alexander-akait
Copy link

alexander-akait commented May 6, 2023

@mvorisek

There is a small bug - https://github.com/vuejs/vue-loader/blob/main/src/index.ts#L285, it should be:

code += `\n\nimport exportComponent from ${stringifyRequest(exportHelperPath)}`;

and https://github.com/vuejs/vue-loader/blob/main/src/index.ts#LL47C1-L47C75, should be:

const exportHelperPath = require.resolve('./exportHelper');

stringifyRequest makes a request relative to context, so you will not have absolute paths and a code generation in the development mode will be more stable, you can send a PR with fix

@alexander-akait
Copy link

This happened because you have node_modules inside js directory, but your source code in src and they are on the same level (i.e. js and src directories)

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

Successfully merging a pull request may close this issue.

2 participants