-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Can I change build directory path from public to anything else? #14703
Comments
@KyleAMathews indicated that it's unlikely this feature will be implemented in the future. I'm closing this for now but feel free to reopen if you still have questions. |
you may use the |
Here's a bit of code that I wrote to accomplish this recently, with the
|
To change the folder from const path = require("path")
const fs = require("fs")
exports.onPreInit = () => {
if (process.argv[2] === "build") {
fs.rmdirSync(path.join(__dirname, "dist"), { recursive: true })
fs.renameSync(
path.join(__dirname, "public"),
path.join(__dirname, "public_dev")
)
}
}
exports.onPostBuild = () => {
fs.renameSync(path.join(__dirname, "public"), path.join(__dirname, "dist"))
fs.renameSync(
path.join(__dirname, "public_dev"),
path.join(__dirname, "public")
)
} |
Does behaviour posted by @abraaoz or @cseebach-tpc still uses "public" in the middle of the process? I mean, what if I want to |
Hi Marek @gitowiec sometimes people - me enclosed - think about too complicated solutions ;-) - my 2 cents First of all, yes - both posted from @abraaoz and @cseebach-tpc will use "/public" in the middle of their process and both are not designed to support a running But, I guess this isn't necessary at all Just use the tools and feel well :-) You can use git to checkout your sources besides your dev folder and run consequent Try this (suggest your project sources are at cd /homes/myproject
mkdir ../myproject-dev
cd ../myproject-dev
find ../myproject -mindepth 1 -maxdepth 1 -exec bash -c 'BASENAME=$(basename "{}"); if [[ "$BASENAME" != ".git" && "$BASENAME" != ".cache" && "$BASENAME" != "public" ]]; then ln -s "{}" "$BASENAME"; fi' \; After that procedure you have a linked dev enabled folder beneath your project. Just start the development server Now you can continue coding and editing your sources in your origin In addition, you may run With that you always have TWO working environments with ONE codebase:
What do you think about that approach? Cheers, P.S.: If you want to run the build command inside the linked folder, you need to exclude |
Hi,
I'm trying to change my build directory path depending on my environment variable. Is it possible???
I already tried
--output-dir
and--build-dir
flag, but both aren't working.Waiting for your response @KyleAMathews
The text was updated successfully, but these errors were encountered: