build: fix cache hash for admin
This commit is contained in:
@@ -19,7 +19,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
manifest: true,
|
manifest: false,
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
outDir: '../../module/oc_telegram_shop/upload/admin/view/javascript/telecart',
|
outDir: '../../module/oc_telegram_shop/upload/admin/view/javascript/telecart',
|
||||||
emptyOutDir: true, // also necessary
|
emptyOutDir: true, // also necessary
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class ControllerExtensionModuleTgshop extends Controller
|
|||||||
{
|
{
|
||||||
$appDir = rtrim(DIR_APPLICATION, '/');
|
$appDir = rtrim(DIR_APPLICATION, '/');
|
||||||
if (file_exists("$appDir/view/javascript/telecart/telecart.js")) {
|
if (file_exists("$appDir/view/javascript/telecart/telecart.js")) {
|
||||||
$hash = md5(file_get_contents($appDir . '/view/javascript/telecart/manifest.json'));
|
$hash = file_get_contents($appDir . '/view/javascript/telecart/checksum.hash');
|
||||||
$this->document->addScript('view/javascript/telecart/telecart.js?v=' . $hash);
|
$this->document->addScript('view/javascript/telecart/telecart.js?v=' . $hash);
|
||||||
$this->document->addStyle('view/javascript/telecart/telecart.css?v=' . $hash);
|
$this->document->addStyle('view/javascript/telecart/telecart.css?v=' . $hash);
|
||||||
} elseif (file_exists("$appDir/view/integration.js")) {
|
} elseif (file_exists("$appDir/view/integration.js")) {
|
||||||
|
|||||||
@@ -42,10 +42,13 @@ cd "${SRC_PATH}/frontend/admin"
|
|||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
echo "Move manifest file"
|
echo "Calculate MD5 hash sum"
|
||||||
cp "${SRC_PATH}/module/oc_telegram_shop/upload/admin/view/javascript/telecart/.vite/manifest.json" \
|
cd ../../module/oc_telegram_shop/upload/admin/view/javascript/telecart
|
||||||
"${SRC_PATH}/module/oc_telegram_shop/upload/admin/view/javascript/telecart/manifest.json"
|
FILES=("telecart.css" "telecart.js")
|
||||||
|
HASH=$(cat "${FILES[@]}" | md5sum | awk '{print $1}')
|
||||||
|
OUTPUT="checksum.hash"
|
||||||
|
echo "$HASH" > "$OUTPUT"
|
||||||
|
echo "Checksum in $OUTPUT: $HASH"
|
||||||
|
|
||||||
cd "$SRC_PATH"
|
cd "$SRC_PATH"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user