Skip to content

Commit

Permalink
[bugfix/3539] fixed issue magento#3539 (magento#3578)
Browse files Browse the repository at this point in the history
* [bugfix/3539] fixed issue magento#3539

* Fix formating issues

Co-authored-by: Jordan Eisenburger <[email protected]>
Co-authored-by: Pedro Chiossi <[email protected]>
Co-authored-by: Pedro M. Chiossi <[email protected]>
  • Loading branch information
4 people committed Dec 21, 2021
1 parent 556eb00 commit 7cf15f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/venia-concept/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ merged-schema*.json
test-report.xml
test-results.json
yarn-error.log
template.generated.html
10 changes: 7 additions & 3 deletions packages/venia-concept/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { configureWebpack, graphQL } = require('@magento/pwa-buildpack');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const fs = require('fs');
const { promisify } = require('util');

const {
getMediaURL,
Expand Down Expand Up @@ -60,6 +61,7 @@ module.exports = async env => {
const mediaUrl = await getMediaURL();
const storeConfigData = await getStoreConfigData();
const { availableStores } = await getAvailableStoresConfigData();
const writeFile = promisify(fs.writeFile);

/**
* Loop the available stores when there is provided STORE_VIEW_CODE
Expand Down Expand Up @@ -89,9 +91,11 @@ module.exports = async env => {
process.env.npm_lifecycle_event &&
process.env.npm_lifecycle_event.includes('watch')
) {
htmlWebpackConfig.templateContent = await getCleanTemplate(
'./template.html'
);
const devTemplate = await getCleanTemplate('./template.html');

// Generate new gitignored html file based on the cleaned template
await writeFile('template.generated.html', devTemplate);
htmlWebpackConfig.template = './template.generated.html';
} else {
htmlWebpackConfig.template = './template.html';
}
Expand Down

0 comments on commit 7cf15f2

Please sign in to comment.