fix: issues
This commit is contained in:
@@ -29,11 +29,13 @@ type posts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List posts
|
// List posts
|
||||||
// @Router /api/posts [get]
|
// @Router /posts [get]
|
||||||
// @Bind pagination query
|
// @Bind pagination query
|
||||||
// @Bind query query
|
// @Bind query query
|
||||||
// @Bind user local
|
// @Bind user local
|
||||||
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery, user *model.Users) (*requests.Pager, error) {
|
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery, user *model.Users) (*requests.Pager, error) {
|
||||||
|
log.Infof("ok", pagination, query.Keyword, user.ID)
|
||||||
|
|
||||||
cond := models.Posts.BuildConditionWithKey(query.Keyword)
|
cond := models.Posts.BuildConditionWithKey(query.Keyword)
|
||||||
pager, err := models.Posts.List(ctx.Context(), pagination, cond, func(item model.Posts) model.Posts {
|
pager, err := models.Posts.List(ctx.Context(), pagination, cond, func(item model.Posts) model.Posts {
|
||||||
item.Assets = fields.ToJson([]fields.MediaAsset{})
|
item.Assets = fields.ToJson([]fields.MediaAsset{})
|
||||||
@@ -41,6 +43,7 @@ func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
|
|||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.WithError(err).Errorf("post list err: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,6 +58,7 @@ func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
|
|||||||
mediaUrls := lo.FilterMap(medias, func(item model.Medias, _ int) (string, bool) {
|
mediaUrls := lo.FilterMap(medias, func(item model.Medias, _ int) (string, bool) {
|
||||||
url, err := ctl.oss.GetSignedUrl(ctx.Context(), item.Path)
|
url, err := ctl.oss.GetSignedUrl(ctx.Context(), item.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.WithError(err).Errorf("head image GetSignedUrl err: %v", err)
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +97,7 @@ type PostItem struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show
|
// Show
|
||||||
// @Router /api/posts/:id [get]
|
// @Router /posts/:id [get]
|
||||||
// @Bind id path
|
// @Bind id path
|
||||||
// @Bind user local
|
// @Bind user local
|
||||||
func (ctl *posts) Show(ctx fiber.Ctx, id int64, user *model.Users) (*PostItem, error) {
|
func (ctl *posts) Show(ctx fiber.Ctx, id int64, user *model.Users) (*PostItem, error) {
|
||||||
@@ -141,7 +145,7 @@ type PlayUrl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Play
|
// Play
|
||||||
// @Router /api/posts/:id/play [get]
|
// @Router /posts/:id/play [get]
|
||||||
// @Bind id path
|
// @Bind id path
|
||||||
// @Bind user local
|
// @Bind user local
|
||||||
func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, error) {
|
func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, error) {
|
||||||
@@ -174,7 +178,7 @@ func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mine posts
|
// Mine posts
|
||||||
// @Router /api/posts/mine [get]
|
// @Router /posts/mine [get]
|
||||||
// @Bind pagination query
|
// @Bind pagination query
|
||||||
// @Bind query query
|
// @Bind query query
|
||||||
func (ctl *posts) Mine(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
|
func (ctl *posts) Mine(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
|
||||||
@@ -187,7 +191,7 @@ func (ctl *posts) Mine(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Buy
|
// Buy
|
||||||
// @Router /api/posts/:id/buy [get]
|
// @Router /posts/:id/buy [get]
|
||||||
// @Bind id path
|
// @Bind id path
|
||||||
// @Bind user local
|
// @Bind user local
|
||||||
func (ctl *posts) Buy(ctx fiber.Ctx, id int64, user *model.Users) (*wechat.JSAPIPayParams, error) {
|
func (ctl *posts) Buy(ctx fiber.Ctx, id int64, user *model.Users) (*wechat.JSAPIPayParams, error) {
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ func Provide(opts ...opt.Option) error {
|
|||||||
auth *auth,
|
auth *auth,
|
||||||
pays *pays,
|
pays *pays,
|
||||||
posts *posts,
|
posts *posts,
|
||||||
weChat *weChat,
|
|
||||||
) (contracts.HttpRoute, error) {
|
) (contracts.HttpRoute, error) {
|
||||||
obj := &Routes{
|
obj := &Routes{
|
||||||
auth: auth,
|
auth: auth,
|
||||||
pays: pays,
|
pays: pays,
|
||||||
posts: posts,
|
posts: posts,
|
||||||
weChat: weChat,
|
|
||||||
}
|
}
|
||||||
if err := obj.Prepare(); err != nil {
|
if err := obj.Prepare(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -73,12 +71,5 @@ func Provide(opts ...opt.Option) error {
|
|||||||
}, atom.GroupRoutes); err != nil {
|
}, atom.GroupRoutes); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := container.Container.Provide(func() (*weChat, error) {
|
|
||||||
obj := &weChat{}
|
|
||||||
|
|
||||||
return obj, nil
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,10 @@ import (
|
|||||||
|
|
||||||
// @provider contracts.HttpRoute atom.GroupRoutes
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
||||||
type Routes struct {
|
type Routes struct {
|
||||||
log *log.Entry `inject:"false"`
|
log *log.Entry `inject:"false"`
|
||||||
auth *auth
|
auth *auth
|
||||||
pays *pays
|
pays *pays
|
||||||
posts *posts
|
posts *posts
|
||||||
weChat *weChat
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Routes) Prepare() error {
|
func (r *Routes) Prepare() error {
|
||||||
@@ -51,41 +50,35 @@ func (r *Routes) Register(router fiber.Router) {
|
|||||||
))
|
))
|
||||||
|
|
||||||
// 注册路由组: posts
|
// 注册路由组: posts
|
||||||
router.Get("/api/posts", DataFunc3(
|
router.Get("/posts", DataFunc3(
|
||||||
r.posts.List,
|
r.posts.List,
|
||||||
Query[requests.Pagination]("pagination"),
|
Query[requests.Pagination]("pagination"),
|
||||||
Query[ListQuery]("query"),
|
Query[ListQuery]("query"),
|
||||||
Local[*model.Users]("user"),
|
Local[*model.Users]("user"),
|
||||||
))
|
))
|
||||||
|
|
||||||
router.Get("/api/posts/:id", DataFunc2(
|
router.Get("/posts/:id", DataFunc2(
|
||||||
r.posts.Show,
|
r.posts.Show,
|
||||||
PathParam[int64]("id"),
|
PathParam[int64]("id"),
|
||||||
Local[*model.Users]("user"),
|
Local[*model.Users]("user"),
|
||||||
))
|
))
|
||||||
|
|
||||||
router.Get("/api/posts/:id/play", DataFunc2(
|
router.Get("/posts/:id/play", DataFunc2(
|
||||||
r.posts.Play,
|
r.posts.Play,
|
||||||
PathParam[int64]("id"),
|
PathParam[int64]("id"),
|
||||||
Local[*model.Users]("user"),
|
Local[*model.Users]("user"),
|
||||||
))
|
))
|
||||||
|
|
||||||
router.Get("/api/posts/mine", DataFunc2(
|
router.Get("/posts/mine", DataFunc2(
|
||||||
r.posts.Mine,
|
r.posts.Mine,
|
||||||
Query[requests.Pagination]("pagination"),
|
Query[requests.Pagination]("pagination"),
|
||||||
Query[ListQuery]("query"),
|
Query[ListQuery]("query"),
|
||||||
))
|
))
|
||||||
|
|
||||||
router.Get("/api/posts/:id/buy", DataFunc2(
|
router.Get("/posts/:id/buy", DataFunc2(
|
||||||
r.posts.Buy,
|
r.posts.Buy,
|
||||||
PathParam[int64]("id"),
|
PathParam[int64]("id"),
|
||||||
Local[*model.Users]("user"),
|
Local[*model.Users]("user"),
|
||||||
))
|
))
|
||||||
|
|
||||||
// 注册路由组: weChat
|
|
||||||
router.Get("/MP_verify_:code.txt", Func1(
|
|
||||||
r.weChat.Verify,
|
|
||||||
PathParam[string]("code"),
|
|
||||||
))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
package http
|
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v3"
|
|
||||||
|
|
||||||
// @provider
|
|
||||||
type weChat struct{}
|
|
||||||
|
|
||||||
// Verify
|
|
||||||
// @Router /MP_verify_:code.txt [get]
|
|
||||||
// @Bind code path
|
|
||||||
func (*weChat) Verify(ctx fiber.Ctx, code string) error {
|
|
||||||
return ctx.SendString(code)
|
|
||||||
}
|
|
||||||
@@ -7,23 +7,21 @@ import (
|
|||||||
"quyun/app/models"
|
"quyun/app/models"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v3"
|
"github.com/gofiber/fiber/v3"
|
||||||
"github.com/gofiber/fiber/v3/log"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (f *Middlewares) Auth(ctx fiber.Ctx) error {
|
func (f *Middlewares) Auth(ctx fiber.Ctx) error {
|
||||||
if strings.HasPrefix(ctx.Path(), "/MP_verify_") {
|
if strings.HasPrefix(ctx.Path(), "/v1/auth/") {
|
||||||
return ctx.Next()
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(ctx.Path(), "/auth/") {
|
|
||||||
return ctx.Next()
|
return ctx.Next()
|
||||||
}
|
}
|
||||||
|
|
||||||
uu, err := models.Users.GetByID(ctx.Context(), 1)
|
uu, err := models.Users.GetByID(ctx.Context(), 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.WithError(err).Error("failed to get user")
|
||||||
return ctx.SendString("NOT OK")
|
return ctx.SendString("NOT OK")
|
||||||
}
|
}
|
||||||
ctx.Locals("user", uu)
|
ctx.Locals("user", uu)
|
||||||
|
log.Infof("set ctx user: %d", uu.ID)
|
||||||
return ctx.Next()
|
return ctx.Next()
|
||||||
|
|
||||||
fullUrl := string(ctx.Request().URI().FullURI())
|
fullUrl := string(ctx.Request().URI().FullURI())
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
package middlewares
|
package middlewares
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v3"
|
"github.com/gofiber/fiber/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (f *Middlewares) AuthAdmin(ctx fiber.Ctx) error {
|
func (f *Middlewares) AuthAdmin(ctx fiber.Ctx) error {
|
||||||
|
if !strings.HasPrefix(ctx.Path(), "/v1/admin") {
|
||||||
|
return ctx.Next()
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.Path() == "/v1/admin/auth" {
|
if ctx.Path() == "/v1/admin/auth" {
|
||||||
return ctx.Next()
|
return ctx.Next()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (f *Middlewares) DebugMode(ctx fiber.Ctx) error {
|
func (f *Middlewares) DebugMode(ctx fiber.Ctx) error {
|
||||||
|
log.Info("------------------")
|
||||||
log.Infof("c.Path: %s", ctx.Path())
|
log.Infof("c.Path: %s", ctx.Path())
|
||||||
log.Infof("Request Method: %s", ctx.Method())
|
log.Infof("Request Method: %s", ctx.Method())
|
||||||
log.Infof("FullURL: %s", ctx.Request().URI().FullURI())
|
log.Infof("FullURL: %s", ctx.Request().URI().FullURI())
|
||||||
|
log.Infof("StartPATH: %s", ctx.Params("*"))
|
||||||
|
log.Info("------------------")
|
||||||
|
|
||||||
return ctx.Next()
|
return ctx.Next()
|
||||||
}
|
}
|
||||||
|
|||||||
19
backend/app/middlewares/mid_wechat_mp_verify.go
Normal file
19
backend/app/middlewares/mid_wechat_mp_verify.go
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package middlewares
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v3"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (f *Middlewares) WechatMpVerify(ctx fiber.Ctx) error {
|
||||||
|
if !strings.HasPrefix(ctx.Path(), "/MP_verify_") {
|
||||||
|
return ctx.Next()
|
||||||
|
}
|
||||||
|
|
||||||
|
path := strings.Replace(ctx.Path(), "MP_verify_", "", 1)
|
||||||
|
path = strings.Replace(path, ".txt", "", 1)
|
||||||
|
path = strings.Trim(path, "/")
|
||||||
|
|
||||||
|
return ctx.SendString(path)
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"quyun/app/errorx"
|
|
||||||
appHttp "quyun/app/http"
|
appHttp "quyun/app/http"
|
||||||
"quyun/app/jobs"
|
"quyun/app/jobs"
|
||||||
"quyun/app/middlewares"
|
"quyun/app/middlewares"
|
||||||
@@ -25,7 +25,9 @@ import (
|
|||||||
"go.ipao.vip/atom/container"
|
"go.ipao.vip/atom/container"
|
||||||
"go.ipao.vip/atom/contracts"
|
"go.ipao.vip/atom/contracts"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v3"
|
||||||
"github.com/gofiber/fiber/v3/middleware/favicon"
|
"github.com/gofiber/fiber/v3/middleware/favicon"
|
||||||
|
"github.com/rogeecn/fabfile"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.uber.org/dig"
|
"go.uber.org/dig"
|
||||||
@@ -84,22 +86,54 @@ func Serve(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
svc.Http.Engine.Get("/swagger/*", swagger.HandlerDefault)
|
svc.Http.Engine.Get("/swagger/*", swagger.HandlerDefault)
|
||||||
}
|
}
|
||||||
svc.Http.Engine.Use(errorx.Middleware)
|
// svc.Http.Engine.Use(errorx.Middleware)
|
||||||
svc.Http.Engine.Use(svc.Middlewares.DebugMode)
|
svc.Http.Engine.Use(svc.Middlewares.DebugMode)
|
||||||
|
|
||||||
svc.Http.Engine.Use(favicon.New(favicon.Config{
|
svc.Http.Engine.Use(favicon.New(favicon.Config{
|
||||||
Data: []byte{},
|
Data: []byte{},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
group := svc.Http.Engine.Group("")
|
group := svc.Http.Engine.
|
||||||
|
Group("v1").
|
||||||
|
Use(
|
||||||
|
svc.Middlewares.WechatMpVerify,
|
||||||
|
svc.Middlewares.Auth,
|
||||||
|
svc.Middlewares.AuthAdmin,
|
||||||
|
)
|
||||||
for _, route := range svc.Routes {
|
for _, route := range svc.Routes {
|
||||||
if route.Name() == "admin" {
|
if route.Name() == "admin" {
|
||||||
route.Register(group.Use(svc.Middlewares.AuthAdmin))
|
route.Register(group)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
route.Register(group.Use(svc.Middlewares.Auth))
|
route.Register(group)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// statics
|
||||||
|
svc.Http.Engine.Get("/admin*", func(ctx fiber.Ctx) error {
|
||||||
|
f := ctx.Params("*")
|
||||||
|
if f == "/" {
|
||||||
|
f = "index.html"
|
||||||
|
}
|
||||||
|
file, err := fabfile.Find(filepath.Join("frontend/admin/dist", f))
|
||||||
|
if err != nil {
|
||||||
|
return ctx.SendStatus(fiber.StatusNotFound)
|
||||||
|
}
|
||||||
|
return ctx.SendFile(file)
|
||||||
|
})
|
||||||
|
svc.Http.Engine.Get("*", func(ctx fiber.Ctx) error {
|
||||||
|
f := ctx.Params("*")
|
||||||
|
if f == "/" || f == "" {
|
||||||
|
f = "index.html"
|
||||||
|
}
|
||||||
|
|
||||||
|
file, err := fabfile.Find(filepath.Join("frontend/wechat/dist", f))
|
||||||
|
if err != nil {
|
||||||
|
return ctx.SendStatus(fiber.StatusNotFound)
|
||||||
|
}
|
||||||
|
return ctx.SendFile(file)
|
||||||
|
})
|
||||||
|
|
||||||
|
// job
|
||||||
if err := svc.Job.Start(ctx); err != nil {
|
if err := svc.Job.Start(ctx); err != nil {
|
||||||
log.WithError(err).Error("job start failed")
|
log.WithError(err).Error("job start failed")
|
||||||
return err
|
return err
|
||||||
|
|||||||
6
backend/dist/dist.go
vendored
Normal file
6
backend/dist/dist.go
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package dist
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed admin/*
|
||||||
|
var Admin embed.FS
|
||||||
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|||||||
|
|
||||||
// Create a base axios instance
|
// Create a base axios instance
|
||||||
export const apiClient = axios.create({
|
export const apiClient = axios.create({
|
||||||
baseURL: import.meta.env.VITE_API_BASE_URL || '',
|
baseURL: import.meta.env.VITE_API_BASE_URL || '/v1',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@@ -4,6 +4,18 @@ import { resolve } from 'path';
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
chunkFileNames: 'static/assets/js/[name]-[hash].js',
|
||||||
|
entryFileNames: 'static/assets/js/[name]-[hash].js',
|
||||||
|
assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
base: "./",
|
||||||
|
minify: true,
|
||||||
|
sourceMap: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|||||||
|
|
||||||
// Create axios instance with default config
|
// Create axios instance with default config
|
||||||
const client = axios.create({
|
const client = axios.create({
|
||||||
baseURL: '/',
|
baseURL: '/v1',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import client from './client';
|
|||||||
|
|
||||||
export const postApi = {
|
export const postApi = {
|
||||||
list({ page = 1, limit = 10, keyword = '' } = {}) {
|
list({ page = 1, limit = 10, keyword = '' } = {}) {
|
||||||
return client.get('/api/posts', {
|
return client.get('/posts', {
|
||||||
params: {
|
params: {
|
||||||
page,
|
page,
|
||||||
limit,
|
limit,
|
||||||
@@ -12,13 +12,13 @@ export const postApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
play(id) {
|
play(id) {
|
||||||
return client.get(`/api/posts/${id}/play`);
|
return client.get(`/posts/${id}/play`);
|
||||||
},
|
},
|
||||||
show(id) {
|
show(id) {
|
||||||
return client.get(`/api/posts/${id}`);
|
return client.get(`/posts/${id}`);
|
||||||
},
|
},
|
||||||
mine({ page = 1, limit = 10 } = {}) {
|
mine({ page = 1, limit = 10 } = {}) {
|
||||||
return client.get('/api/posts/mine', {
|
return client.get('/posts/mine', {
|
||||||
params: {
|
params: {
|
||||||
page,
|
page,
|
||||||
limit
|
limit
|
||||||
@@ -26,6 +26,6 @@ export const postApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
buy(id) {
|
buy(id) {
|
||||||
return client.post(`/api/posts/buy/${id}`);
|
return client.post(`/posts/buy/${id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,18 @@ import { resolve } from 'path';
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
chunkFileNames: 'static/assets/js/[name]-[hash].js',
|
||||||
|
entryFileNames: 'static/assets/js/[name]-[hash].js',
|
||||||
|
assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
base: "./",
|
||||||
|
minify: true,
|
||||||
|
sourceMap: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
|
|||||||
Reference in New Issue
Block a user