优化前端构建资源和缓存控制

This commit is contained in:
WuYongJie 2026-07-21 20:05:26 +08:00
parent 0199365b08
commit 26ce30d25a
14 changed files with 280 additions and 105 deletions

View File

@ -106,7 +106,9 @@
### 8.4 磁盘和缓存上限
- Docker Desktop 虚拟磁盘上限建议设为 60GB;宿主机至少保留 15GB 可用空间。前端打包使用宿主机内存,不要求为了本项目调高 Docker 虚拟机内存。
- 发布脚本使用独立缓存并将 BuildKit 缓存控制在 8GB 内,只清理 7 天前的本项目缓存。
- 发布脚本使用独立缓存并将 BuildKit 缓存控制在 3GB 内,只清理 7 天前的本项目缓存。
- 前端 Node 堆内存默认上限为 4GB,JavaScript 压缩默认最多使用 2 个工作线程;不得为了追求构建速度取消限制。
- `package-lock.json` 和 Node 版本未变化时复用 `node_modules`;页面模板变化只重建 Tailwind CSS,只有 JavaScript 源码或依赖变化才重新打包 JavaScript。
- 开发机、服务器 Docker 和服务器本机 Registry 默认各保留 2 个本项目版本;上传用临时 `image.tar` 无论成功失败都必须删除。
- 禁止脚本自动执行全局 `docker system prune -a`、删除其他项目镜像、删除卷或重置 Docker Desktop。
- Docker 虚拟磁盘文件不会因为普通清理立即缩小;日常目标是控制已用空间不再增长,不得让新人自行删除或重建虚拟磁盘。

View File

@ -33,11 +33,12 @@
项目使用专属构建器 `caiwu-builder`,缓存与其他项目分开:
- 前端在 Windows 主机使用项目专用 Node 20 构建,避开 Docker 虚拟机内存上限;
- 前端输入指纹未变化时直接复用上次产物,纯后端改动不重复打包前端;
- JavaScript、Tailwind CSS 使用独立输入指纹;页面模板变化只重建 CSS,纯后端改动不重复打包前端;
- PHP 扩展层只在 Dockerfile 的基础环境变化时重建;
- Composer 只在 `composer.lock` 变化时重新解析依赖,并复用下载缓存;
- npm 优先使用本机下载缓存,`node_modules` 原位刷新,不会逐版本堆积;
- 业务代码变化只重新执行前端资源构建和后面的代码复制;
- npm 优先使用本机下载缓存;`package-lock.json` 和 Node 版本未变化时直接复用 `node_modules`;
- JavaScript 公共依赖抽取为共享包,Node 堆上限为 4GB,压缩线程默认限制为 2;
- 业务代码变化只重新执行镜像中的代码复制;
- 日常命令不带 `--pull` 和 `--no-cache`。
- 首次初始化才上传应用和 MariaDB 的全量包;日常发布通过 SSH 隧道连接服务器本机 Registry。
- Registry 按内容哈希判断镜像层是否已经存在,基础环境、PHP 依赖和未变化的前端层不会重复上传。
@ -107,7 +108,7 @@ git pull --ff-only
8. 使用服务器互斥锁阻止两个人同时切换版本;
9. 删除本地临时镜像包并关闭 SSH 隧道;
10. 开发机、服务器 Docker 和服务器 Registry 均仅保留当前和上一个本项目版本;
11. 清理 7 天前的本项目构建缓存,并将总量压到最多 8GB。
11. 清理 7 天前的本项目构建缓存,并将总量压到最多 3GB。
## 6. 数据库迁移

View File

@ -1,5 +1,6 @@
<!-- Core -->
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
@include('components.layouts.partials.frontend-runtime')
<script type="text/javascript">
var company_currency_code = '{{ default_currency() }}';

View File

@ -1,3 +1,5 @@
@include('components.layouts.partials.frontend-runtime')
@stack('scripts_start')
<!-- <script type="text/javascript" src="{{ asset('public/akaunting-js/hotkeys.js') }}" defer></script> -->

View File

@ -1,3 +1,5 @@
@include('components.layouts.partials.frontend-runtime')
@stack('scripts_start')
<script src="{{ asset('public/js/install.min.js?v=' . version('short')) }}"></script>

View File

@ -0,0 +1,2 @@
<script src="{{ asset('public/js/manifest.js?v=' . version('short')) }}"></script>
<script src="{{ asset('public/js/vendor.js?v=' . version('short')) }}"></script>

View File

@ -1,5 +1,6 @@
<!-- Core -->
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
@include('components.layouts.partials.frontend-runtime')
<script type="text/javascript">
var company_currency_code = '{{ default_currency() }}';

View File

@ -1,3 +1,5 @@
@include('components.layouts.partials.frontend-runtime')
@stack('scripts_start')
@stack('body_css')

View File

@ -1,5 +1,6 @@
<!-- Core -->
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
@include('components.layouts.partials.frontend-runtime')
<script type="text/javascript">
var company_currency_code = '{{ default_currency() }}';

View File

@ -1,3 +1,5 @@
@include('components.layouts.partials.frontend-runtime')
@stack('scripts_start')
@stack('body_css')

View File

@ -1,3 +1,5 @@
@include('components.layouts.partials.frontend-runtime')
@stack('scripts_start')
<!-- Core -->

View File

@ -1,7 +1,10 @@
[CmdletBinding()]
param(
[string]$NodeVersion = '20.20.2',
[int]$MaxOldSpaceSizeMB = 8192
[ValidateRange(1024, 8192)]
[int]$MaxOldSpaceSizeMB = 4096,
[ValidateRange(1, 8)]
[int]$TerserWorkers = 2
)
$ErrorActionPreference = 'Stop'
@ -15,8 +18,15 @@ $archiveName = "$nodeFolderName.zip"
$archivePath = Join-Path $toolRoot $archiveName
$checksumPath = Join-Path $toolRoot 'SHASUMS256.txt'
$trackedCssPath = Join-Path $repoRoot 'public/css/app.css'
$frontendOutputRoot = Join-Path $repoRoot '.caiwu-build/public'
$fingerprintPath = Join-Path $repoRoot '.caiwu-build/frontend.sha'
$publicJsPath = Join-Path $repoRoot 'public/js'
$publicManifestPath = Join-Path $repoRoot 'public/mix-manifest.json'
$frontendCacheRoot = Join-Path $repoRoot '.caiwu-build'
$frontendOutputRoot = Join-Path $frontendCacheRoot 'public'
$jsFingerprintPath = Join-Path $frontendCacheRoot 'frontend-js.sha'
$cssFingerprintPath = Join-Path $frontendCacheRoot 'frontend-css.sha'
$dependencyFingerprintPath = Join-Path $frontendCacheRoot 'node-modules.sha'
$jsManifestCachePath = Join-Path $frontendCacheRoot 'manifest-js.json'
$cssManifestCachePath = Join-Path $frontendCacheRoot 'manifest-css.json'
function Invoke-Native {
param(
@ -32,27 +42,108 @@ function Invoke-Native {
}
}
$fingerprintInputs = @(
'HEAD:resources',
'HEAD:package.json',
'HEAD:package-lock.json',
'HEAD:webpack.mix.js',
'HEAD:tailwind.config.js'
)
$fingerprintHashes = @(& git -C $repoRoot rev-parse @fingerprintInputs)
if ($LASTEXITCODE -ne 0) {
throw '无法计算前端输入指纹。'
function Get-PathFingerprint {
param([Parameter(Mandatory = $true)][string[]]$Paths)
$files = foreach ($relativePath in $Paths) {
$fullPath = Join-Path $repoRoot $relativePath
if (Test-Path -LiteralPath $fullPath -PathType Leaf) {
Get-Item -LiteralPath $fullPath
}
elseif (Test-Path -LiteralPath $fullPath -PathType Container) {
Get-ChildItem -LiteralPath $fullPath -Recurse -File
}
else {
throw "Frontend fingerprint path does not exist: $relativePath"
}
}
[string[]]$fullPaths = @($files | ForEach-Object { $_.FullName })
[Array]::Sort($fullPaths, [StringComparer]::Ordinal)
$fingerprintLines = foreach ($fullPath in $fullPaths) {
$relativePath = $fullPath.Substring($repoRoot.Length).TrimStart('\', '/').Replace('\', '/')
$hash = (Get-FileHash -LiteralPath $fullPath -Algorithm SHA256).Hash.ToLowerInvariant()
"$relativePath|$hash"
}
$bytes = [Text.Encoding]::UTF8.GetBytes(($fingerprintLines -join "`n"))
$sha256 = [Security.Cryptography.SHA256]::Create()
try {
return (($sha256.ComputeHash($bytes) | ForEach-Object { $_.ToString('x2') }) -join '')
}
finally {
$sha256.Dispose()
}
}
$frontendFingerprint = "$NodeVersion|$($fingerprintHashes -join '|')"
$cachedOutputs = @(
(Join-Path $frontendOutputRoot 'js/auth/common.min.js'),
(Join-Path $frontendOutputRoot 'css/app.css'),
(Join-Path $frontendOutputRoot 'mix-manifest.json'),
$fingerprintPath
function Test-CacheFingerprint {
param(
[Parameter(Mandatory = $true)][string]$FingerprintPath,
[Parameter(Mandatory = $true)][string]$Expected,
[Parameter(Mandatory = $true)][string[]]$RequiredOutputs
)
if (-not (Test-Path -LiteralPath $FingerprintPath)) {
return $false
}
foreach ($output in $RequiredOutputs) {
if (-not (Test-Path -LiteralPath $output)) {
return $false
}
}
return (Get-Content -Raw -LiteralPath $FingerprintPath).Trim() -eq $Expected
}
function Write-Utf8NoBom {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Value
)
[IO.File]::WriteAllText($Path, $Value, [Text.UTF8Encoding]::new($false))
}
$packageLockHash = Get-PathFingerprint @('package-lock.json')
$jsFingerprintInputs = @(
'resources/assets/js',
'package.json',
'package-lock.json',
'webpack.mix.js'
)
$cacheComplete = -not ($cachedOutputs | Where-Object { -not (Test-Path -LiteralPath $_) })
if ($cacheComplete -and (Get-Content -Raw -LiteralPath $fingerprintPath).Trim() -eq $frontendFingerprint) {
Write-Host '前端输入未变化,复用已有构建产物。'
$cssFingerprintInputs = @(
'resources/assets/sass',
'resources/views',
'resources/lang',
'package.json',
'package-lock.json',
'webpack.mix.js',
'tailwind.config.js',
'presets.js',
'safelist.txt',
'composer.lock'
)
$jsFingerprint = "$NodeVersion|$TerserWorkers|$(Get-PathFingerprint $jsFingerprintInputs)"
$cssFingerprint = "$NodeVersion|$(Get-PathFingerprint $cssFingerprintInputs)"
$dependencyFingerprint = "$NodeVersion|$packageLockHash"
$jsCacheValid = Test-CacheFingerprint `
-FingerprintPath $jsFingerprintPath `
-Expected $jsFingerprint `
-RequiredOutputs @(
(Join-Path $frontendOutputRoot 'js/auth/common.min.js'),
(Join-Path $frontendOutputRoot 'js/manifest.js'),
(Join-Path $frontendOutputRoot 'js/vendor.js'),
$jsManifestCachePath
)
$cssCacheValid = Test-CacheFingerprint `
-FingerprintPath $cssFingerprintPath `
-Expected $cssFingerprint `
-RequiredOutputs @(
(Join-Path $frontendOutputRoot 'css/app.css'),
$cssManifestCachePath
)
if ($jsCacheValid -and $cssCacheValid) {
Write-Host 'Frontend inputs unchanged. Reusing JavaScript, CSS, and dependency caches.'
return
}
@ -67,13 +158,13 @@ if (-not (Test-Path -LiteralPath $nodeExe)) {
$checksumLine = Select-String -Path $checksumPath -Pattern ([regex]::Escape($archiveName) + '$') |
Select-Object -First 1
if (-not $checksumLine) {
throw 'Node 安装包缺少官方 SHA-256 校验值。'
throw 'The Node archive is missing its official SHA-256 checksum.'
}
$expectedHash = ($checksumLine.Line -split '\s+')[0].ToLowerInvariant()
$actualHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $archivePath).Hash.ToLowerInvariant()
if ($actualHash -ne $expectedHash) {
throw 'Node 安装包 SHA-256 校验失败。'
throw 'The Node archive SHA-256 checksum verification failed.'
}
Expand-Archive -LiteralPath $archivePath -DestinationPath $toolRoot -Force
@ -89,11 +180,13 @@ if (-not (Test-Path -LiteralPath $nodeExe)) {
}
if (-not (Test-Path -LiteralPath $nodeExe) -or -not (Test-Path -LiteralPath $npmCmd)) {
throw "项目专用 Node $NodeVersion 安装不完整。"
throw "The project-local Node $NodeVersion installation is incomplete."
}
$originalPath = $env:Path
$originalNodeOptions = $env:NODE_OPTIONS
$originalBuildTarget = $env:CAIWU_BUILD_TARGET
$originalTerserWorkers = $env:CAIWU_TERSER_WORKERS
$trackedCssBackup = if (Test-Path -LiteralPath $trackedCssPath) {
[IO.File]::ReadAllBytes($trackedCssPath)
}
@ -105,37 +198,89 @@ Push-Location $repoRoot
try {
$env:Path = "$nodeRoot;$originalPath"
$env:NODE_OPTIONS = "--max-old-space-size=$MaxOldSpaceSizeMB"
$env:CAIWU_TERSER_WORKERS = $TerserWorkers.ToString()
Invoke-Native { & $nodeExe --version } '项目专用 Node 无法运行。'
Invoke-Native {
& $npmCmd ci --prefer-offline --no-audit --no-fund
} '前端依赖安装失败。'
Invoke-Native { & $npmCmd run production } '前端资源构建失败。'
Invoke-Native { & $nodeExe --version } 'The project-local Node executable failed.'
$requiredOutputs = @(
'public/js/auth/common.min.js',
'public/css/app.css',
'public/mix-manifest.json'
)
foreach ($output in $requiredOutputs) {
if (-not (Test-Path -LiteralPath (Join-Path $repoRoot $output))) {
throw "前端构建缺少产物:$output"
$dependencyCacheValid = `
(Test-Path -LiteralPath (Join-Path $repoRoot 'node_modules/.package-lock.json')) -and `
(Test-Path -LiteralPath $dependencyFingerprintPath) -and `
((Get-Content -Raw -LiteralPath $dependencyFingerprintPath).Trim() -eq $dependencyFingerprint)
if ($dependencyCacheValid) {
Write-Host 'package-lock.json unchanged. Reusing node_modules.'
}
else {
Invoke-Native {
& $npmCmd ci --prefer-offline --no-audit --no-fund
} 'Frontend dependency installation failed.'
New-Item -ItemType Directory -Force -Path $frontendCacheRoot | Out-Null
Write-Utf8NoBom -Path $dependencyFingerprintPath -Value $dependencyFingerprint
}
if (-not $jsCacheValid) {
Write-Host "Building JavaScript with a ${MaxOldSpaceSizeMB}MB Node heap and $TerserWorkers minifier workers."
if (Test-Path -LiteralPath $publicJsPath) {
Remove-Item -LiteralPath $publicJsPath -Recurse -Force
}
$env:CAIWU_BUILD_TARGET = 'js'
Invoke-Native { & $npmCmd run production } 'Frontend JavaScript build failed.'
foreach ($output in @(
'public/js/auth/common.min.js',
'public/js/manifest.js',
'public/js/vendor.js',
'public/mix-manifest.json'
)) {
if (-not (Test-Path -LiteralPath (Join-Path $repoRoot $output))) {
throw "JavaScript build output is missing: $output"
}
}
$cachedJsPath = Join-Path $frontendOutputRoot 'js'
if (Test-Path -LiteralPath $cachedJsPath) {
Remove-Item -LiteralPath $cachedJsPath -Recurse -Force
}
New-Item -ItemType Directory -Force -Path $frontendOutputRoot | Out-Null
Copy-Item -LiteralPath $publicJsPath -Destination $frontendOutputRoot -Recurse
Copy-Item -LiteralPath $publicManifestPath -Destination $jsManifestCachePath -Force
Write-Utf8NoBom -Path $jsFingerprintPath -Value $jsFingerprint
}
if (-not $cssCacheValid) {
Write-Host "Building CSS with a ${MaxOldSpaceSizeMB}MB Node heap."
$env:CAIWU_BUILD_TARGET = 'css'
Invoke-Native { & $npmCmd run production } 'Frontend CSS build failed.'
foreach ($output in @('public/css/app.css', 'public/mix-manifest.json')) {
if (-not (Test-Path -LiteralPath (Join-Path $repoRoot $output))) {
throw "CSS build output is missing: $output"
}
}
New-Item -ItemType Directory -Force -Path (Join-Path $frontendOutputRoot 'css') | Out-Null
Copy-Item -LiteralPath $trackedCssPath -Destination (Join-Path $frontendOutputRoot 'css/app.css') -Force
Copy-Item -LiteralPath $publicManifestPath -Destination $cssManifestCachePath -Force
Write-Utf8NoBom -Path $cssFingerprintPath -Value $cssFingerprint
}
$mergedManifest = [ordered]@{}
foreach ($manifestPath in @($jsManifestCachePath, $cssManifestCachePath)) {
$manifest = Get-Content -Raw -LiteralPath $manifestPath | ConvertFrom-Json
foreach ($property in $manifest.PSObject.Properties) {
$mergedManifest[$property.Name] = $property.Value
}
}
if (Test-Path -LiteralPath $frontendOutputRoot) {
Remove-Item -LiteralPath $frontendOutputRoot -Recurse -Force
}
New-Item -ItemType Directory -Force -Path (Join-Path $frontendOutputRoot 'css') | Out-Null
Copy-Item -LiteralPath (Join-Path $repoRoot 'public/js') -Destination $frontendOutputRoot -Recurse
Copy-Item -LiteralPath (Join-Path $repoRoot 'public/css/app.css') -Destination (Join-Path $frontendOutputRoot 'css/app.css')
Copy-Item -LiteralPath (Join-Path $repoRoot 'public/mix-manifest.json') -Destination $frontendOutputRoot
Set-Content -LiteralPath $fingerprintPath -Value $frontendFingerprint -NoNewline
$mergedManifestJson = $mergedManifest | ConvertTo-Json
Write-Utf8NoBom -Path (Join-Path $frontendOutputRoot 'mix-manifest.json') -Value $mergedManifestJson
Write-Utf8NoBom -Path $publicManifestPath -Value $mergedManifestJson
}
finally {
Pop-Location
$env:Path = $originalPath
$env:NODE_OPTIONS = $originalNodeOptions
$env:CAIWU_BUILD_TARGET = $originalBuildTarget
$env:CAIWU_TERSER_WORKERS = $originalTerserWorkers
if ($null -ne $trackedCssBackup) {
[IO.File]::WriteAllBytes($trackedCssPath, $trackedCssBackup)
}

View File

@ -396,10 +396,10 @@ finally {
$pruneHelp = docker buildx prune --help 2>$null | Out-String
docker buildx prune --builder $BuilderName --filter 'until=168h' --force 2>$null | Out-Null
if ($pruneHelp -match '--max-used-space') {
docker buildx prune --builder $BuilderName --max-used-space 8GB --force 2>$null | Out-Null
docker buildx prune --builder $BuilderName --max-used-space 3GB --force 2>$null | Out-Null
}
elseif ($pruneHelp -match '--keep-storage') {
docker buildx prune --builder $BuilderName --keep-storage 8GB --force 2>$null | Out-Null
docker buildx prune --builder $BuilderName --keep-storage 3GB --force 2>$null | Out-Null
}
docker system df

114
webpack.mix.js vendored
View File

@ -1,6 +1,11 @@
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
const buildTarget = process.env.CAIWU_BUILD_TARGET || 'all';
const buildJavaScript = buildTarget === 'all' || buildTarget === 'js';
const buildCss = buildTarget === 'all' || buildTarget === 'css';
const terserWorkers = Math.max(1, Number.parseInt(process.env.CAIWU_TERSER_WORKERS || '2', 10));
/*
|--------------------------------------------------------------------------
| Mix Asset Management
@ -27,71 +32,78 @@ mix
},
})
.options({
runtimeChunkPath: 'js',
terser: {
extractComments: false,
parallel: terserWorkers,
}
})
});
// Auth
.js('resources/assets/js/views/auth/common.js', 'public/js/auth/common.min.js')
.js('resources/assets/js/views/auth/users.js', 'public/js/auth/users.min.js')
if (buildJavaScript) {
mix
// Auth
.js('resources/assets/js/views/auth/common.js', 'public/js/auth/common.min.js')
.js('resources/assets/js/views/auth/users.js', 'public/js/auth/users.min.js')
// Banking
.js('resources/assets/js/views/banking/accounts.js', 'public/js/banking/accounts.min.js')
.js('resources/assets/js/views/banking/transactions.js', 'public/js/banking/transactions.min.js')
.js('resources/assets/js/views/banking/transfers.js', 'public/js/banking/transfers.min.js')
.js('resources/assets/js/views/banking/reconciliations.js', 'public/js/banking/reconciliations.min.js')
// Banking
.js('resources/assets/js/views/banking/accounts.js', 'public/js/banking/accounts.min.js')
.js('resources/assets/js/views/banking/transactions.js', 'public/js/banking/transactions.min.js')
.js('resources/assets/js/views/banking/transfers.js', 'public/js/banking/transfers.min.js')
.js('resources/assets/js/views/banking/reconciliations.js', 'public/js/banking/reconciliations.min.js')
// Common
.js('resources/assets/js/views/common/contacts.js', 'public/js/common/contacts.min.js')
.js('resources/assets/js/views/common/companies.js', 'public/js/common/companies.min.js')
.js('resources/assets/js/views/common/dashboards.js', 'public/js/common/dashboards.min.js')
.js('resources/assets/js/views/common/documents.js', 'public/js/common/documents.min.js')
.js('resources/assets/js/views/common/imports.js', 'public/js/common/imports.min.js')
.js('resources/assets/js/views/common/items.js', 'public/js/common/items.min.js')
.js('resources/assets/js/views/common/reports.js', 'public/js/common/reports.min.js')
// Common
.js('resources/assets/js/views/common/contacts.js', 'public/js/common/contacts.min.js')
.js('resources/assets/js/views/common/companies.js', 'public/js/common/companies.min.js')
.js('resources/assets/js/views/common/dashboards.js', 'public/js/common/dashboards.min.js')
.js('resources/assets/js/views/common/documents.js', 'public/js/common/documents.min.js')
.js('resources/assets/js/views/common/imports.js', 'public/js/common/imports.min.js')
.js('resources/assets/js/views/common/items.js', 'public/js/common/items.min.js')
.js('resources/assets/js/views/common/reports.js', 'public/js/common/reports.min.js')
// Install
.js('resources/assets/js/install.js', 'public/js/install.min.js')
.js('resources/assets/js/views/install/update.js', 'public/js/install/update.min.js')
// Install
.js('resources/assets/js/install.js', 'public/js/install.min.js')
.js('resources/assets/js/views/install/update.js', 'public/js/install/update.min.js')
//Wizard
.js('resources/assets/js/wizard.js', 'public/js/wizard/wizard.min.js')
// Wizard
.js('resources/assets/js/wizard.js', 'public/js/wizard/wizard.min.js')
// Modules
.js('resources/assets/js/views/modules/apps.js', 'public/js/modules/apps.min.js')
// Modules
.js('resources/assets/js/views/modules/apps.js', 'public/js/modules/apps.min.js')
// Business workspace(店铺管理 › 各子功能)
.js('resources/assets/js/views/business/pages.js', 'public/js/business/pages.min.js')
// Business workspace(店铺管理 › 各子功能)
.js('resources/assets/js/views/business/pages.js', 'public/js/business/pages.min.js')
// Ecommerce Finance
.js('resources/assets/js/views/ecommerce-finance/goods-reconciliations.js', 'public/js/ecommerce-finance/goods-reconciliations.min.js')
.js('resources/assets/js/views/ecommerce-finance/return-reconciliations.js', 'public/js/ecommerce-finance/return-reconciliations.min.js')
.js('resources/assets/js/views/ecommerce-finance/invoice-deductions.js', 'public/js/ecommerce-finance/invoice-deductions.min.js')
.js('resources/assets/js/views/ecommerce-finance/compensation-details.js', 'public/js/ecommerce-finance/compensation-details.min.js')
.js('resources/assets/js/views/ecommerce-finance/advance-details.js', 'public/js/ecommerce-finance/advance-details.min.js')
.js('resources/assets/js/views/ecommerce-finance/sample-deductions.js', 'public/js/ecommerce-finance/sample-deductions.min.js')
.js('resources/assets/js/views/ecommerce-finance/delivery-unpriced.js', 'public/js/ecommerce-finance/delivery-unpriced.min.js')
.js('resources/assets/js/views/ecommerce-finance/return-unpriced.js', 'public/js/ecommerce-finance/return-unpriced.min.js')
.js('resources/assets/js/views/ecommerce-finance/other-adjustments.js', 'public/js/ecommerce-finance/other-adjustments.min.js')
.js('resources/assets/js/views/ecommerce-finance/dropshipping-express.js', 'public/js/ecommerce-finance/dropshipping-express.min.js')
// Ecommerce Finance
.js('resources/assets/js/views/ecommerce-finance/goods-reconciliations.js', 'public/js/ecommerce-finance/goods-reconciliations.min.js')
.js('resources/assets/js/views/ecommerce-finance/return-reconciliations.js', 'public/js/ecommerce-finance/return-reconciliations.min.js')
.js('resources/assets/js/views/ecommerce-finance/invoice-deductions.js', 'public/js/ecommerce-finance/invoice-deductions.min.js')
.js('resources/assets/js/views/ecommerce-finance/compensation-details.js', 'public/js/ecommerce-finance/compensation-details.min.js')
.js('resources/assets/js/views/ecommerce-finance/advance-details.js', 'public/js/ecommerce-finance/advance-details.min.js')
.js('resources/assets/js/views/ecommerce-finance/sample-deductions.js', 'public/js/ecommerce-finance/sample-deductions.min.js')
.js('resources/assets/js/views/ecommerce-finance/delivery-unpriced.js', 'public/js/ecommerce-finance/delivery-unpriced.min.js')
.js('resources/assets/js/views/ecommerce-finance/return-unpriced.js', 'public/js/ecommerce-finance/return-unpriced.min.js')
.js('resources/assets/js/views/ecommerce-finance/other-adjustments.js', 'public/js/ecommerce-finance/other-adjustments.min.js')
.js('resources/assets/js/views/ecommerce-finance/dropshipping-express.js', 'public/js/ecommerce-finance/dropshipping-express.min.js')
// Portal
.js('resources/assets/js/views/portal/apps.js', 'public/js/portal/apps.min.js')
// Portal
.js('resources/assets/js/views/portal/apps.js', 'public/js/portal/apps.min.js')
// Settings
.js('resources/assets/js/views/settings/categories.js', 'public/js/settings/categories.min.js')
.js('resources/assets/js/views/settings/currencies.js', 'public/js/settings/currencies.min.js')
.js('resources/assets/js/views/settings/settings.js', 'public/js/settings/settings.min.js')
.js('resources/assets/js/views/settings/taxes.js', 'public/js/settings/taxes.min.js')
// Settings
.js('resources/assets/js/views/settings/categories.js', 'public/js/settings/categories.min.js')
.js('resources/assets/js/views/settings/currencies.js', 'public/js/settings/currencies.min.js')
.js('resources/assets/js/views/settings/settings.js', 'public/js/settings/settings.min.js')
.js('resources/assets/js/views/settings/taxes.js', 'public/js/settings/taxes.min.js')
.vue()
.extract('public/js/vendor.js');
}
.vue()
.postCss('resources/assets/sass/app.css', 'public/css', [
if (buildCss) {
mix.postCss('resources/assets/sass/app.css', 'public/css', [
require('tailwindcss')
])
.tailwind('./tailwind.config.js')
.tailwind('./tailwind.config.js');
}
if (mix.inProduction()) {
mix.version()
}
if (mix.inProduction()) {
mix.version();
}