支持cdn文件上传至s3

This commit is contained in:
2024-06-08 12:47:24 +08:00
parent 5f56e651a2
commit d76e2f265c
3 changed files with 277 additions and 3 deletions

View File

@ -1,5 +1,21 @@
const mix = require('laravel-mix');
const S3PusherPlugin = require('webpack-s3-pusher');
require('laravel-mix-versionhash');
if (mix.inProduction()) {
mix.webpackConfig({
plugins: [
new S3PusherPlugin({
key: process.env.AWS_ACCESS_KEY_ID,
secret: process.env.AWS_SECRET_ACCESS_KEY,
bucket: "cdn",
region: process.env.AWS_DEFAULT_REGION,
endpoint: process.env.AWS_ENDPOINT,
prefix: 'lubo',
})
]
});
}
/*
|--------------------------------------------------------------------------
| Mix Asset Management
@ -22,7 +38,7 @@ mix
])
.disableNotifications();
if (mix.inProduction()) {
mix.version();
mix.versionHash();
} else {
mix.sourceMaps()
}