-
Notifications
You must be signed in to change notification settings - Fork 32
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
The copyAssetsToPublic hook doesn't copy dotfiles files like .htaccess #26
Comments
hey! i wrote those lines of code. you're free to modify those for whatever needs. i'm not sure about the intention but perhaps it avoids internals like |
To copy {
hook: 'bootstrap',
name: 'copyAssetsToPublic',
description:
'Copies ./assets/ to the "distDir" defined in the elder.config.js. This function helps support the live reload process.',
run: ({ settings }) => {
// Note that this function doesn't manipulate any props or return anything.
// It is just executed on the 'bootstrap' hook which runs once when Elder.js is starting.
// Copy assets folder to public destination
glob.sync(path.resolve(settings.rootDir, './assets/**/*'), {dot: true, nodir: true, ignore: ['.DS_Store']}).forEach((file) => {
const relativeToAssetsFolder = path.relative(path.join(settings.rootDir, './assets'), file);
const outputPath = path.resolve(settings.distDir, relativeToAssetsFolder);
fs.ensureDirSync(path.parse(outputPath).dir);
fs.outputFileSync(outputPath, fs.readFileSync(file));
});
},
}, |
I ran into this issue today. I was trying to get a |
Hi!
Due to
glob.sync()
not having{ dot: true }
as theoptions
parameter anddotfiles are not copied.
I have 2 questions:
The text was updated successfully, but these errors were encountered: