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

Production Build Cross-Compatibility #11

Open
brentspector opened this issue Nov 28, 2021 · 1 comment
Open

Production Build Cross-Compatibility #11

brentspector opened this issue Nov 28, 2021 · 1 comment

Comments

@brentspector
Copy link

Hello. I have found this action to be very useful in my automated workflow. However, I am looking to develop mobile apps using the same production codebase. Unfortunately, the vue.config.js will always insert the GH Pages sub-path whenever a production build is run. This causes the dist to be unusable for anything but GH Pages as other applications expect to use root.

At the moment this Github Action is the only thing that uses the sub-path. I would appreciate the ability to specify a build target rather than assume it's "npm run build". This would let me specify a new target that uses a mode other than "production" so that GH Pages gets the path it needs without polluting the other types of distributions.

Example in Vue - https://cli.vuejs.org/guide/mode-and-env.html#example-staging-mode

@lewisdoesstuff
Copy link

Hey! I don't know if you ever got this solved, but here's my solution.

I've created a fork of the package, changing the npm run build to npm run build-pages.
You can add a build-pages action to your package.json as below:
"build-pages": "vite build --base=/{REPO_NAME}/",

Setting the base var in vite.config.js/vue.config.js back to '/' will let you run your prod build as normal, then create a pages build with the modified base path.

You can find the modified action at lewisdoesstuff/VuePagesAction

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

No branches or pull requests

2 participants