Closed nicosomb closed 3 months ago
I know that some variables will remain empty, but the build seems ok like this.
Removing .env dependency will help us to ship hummingbird in prestashop core.
I know that there were some reasons ... but we can't find them.
PR that introduced this, with discussion - https://github.com/PrestaShop/hummingbird/pull/67
OK so it seems that you warned about this issue...
@nicosomb .env file is being used by webpack-dev-server mostly to improve DX. Why would you like to get ride of this like this 🤔.
@Oksydan I understand, but can you tell us how can we ship it in PrestaShop core please ?
We want to add Hummingbird as a dependency in composer.json (see my PR here https://github.com/PrestaShop/PrestaShop/pull/36198). So we have to know how to fill the .env file during the assets build process.
Hmmmmm we could pass arguments in the compilation process. If the process is building a theme, we could simply not check if the .env
file exists, otherwise check for its existence and terminate the process. For missing values from env, we could set default values:
const {
PORT: port = null,
PUBLIC_PATH: publicPath = null,
SERVER_ADDRESS: serverAddress = null,
SITE_URL: siteURL = null,
} = process.env;
THB we do not need these values in the compilation process. It is only required for the development process.
@Oksydan thank you for the details. I will improve my PR.
@Hlavtox we have to go forward, could you please remove your request approval? if necessary, we can still open a new PR later.
Hello @nicosomb ,
What are the steps to reproduce ? Do we just need to make sure the theme is well installed ?
This PR allows to fix the issue I have here https://github.com/PrestaShop/PrestaShop/pull/36198#issuecomment-2122042886 to embed HB in PrestaShop core.