mojito部署

mojito laravel+elm 前后分离后台

部署安装文档中题的部署出现的问题

环境-mac laradock php-7.2 mysql-5.7 部署mojito1.1.*

ERROR in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Module not found: Error: Can't resolve '/var/www/mojito/resources/assets/js/app.js' in '/var/www/mojito'
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss /js/app[0]

原文档内容

Mix 引入 admin.js

mix.js(‘resources/assets/js/app.js’, ‘public/js’)
.sass(‘resources/assets/sass/app.scss’, ‘public/css’)
//.js(‘resources/js/admin.js’, ‘public/js’) laravel5.7+
.js(‘resources/assets/js/admin.js’, ‘public/js’)

实验后

将下面代码替换文件原来的内容-(文件在跟目录) webpack.mix.js

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .js('resources/js/admin.js', 'public/js');

由于是部署在laradock中所以不能直接访问localhost

nginx-vhost

server {

    listen 80;
    listen [::]:80;

    # For https
    # listen 443 ssl;
    # listen [::]:443 ssl ipv6only=on;
    # ssl_certificate /etc/nginx/ssl/default.crt;
    # ssl_certificate_key /etc/nginx/ssl/default.key;

    server_name mojito.test;
    root /var/www/mojito/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_pass php-upstream;
        fastcgi_index index.php;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #fixes timeouts
        fastcgi_read_timeout 600;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt/;
        log_not_found off;
    }

    error_log /var/log/nginx/laravel_error.log;
    access_log /var/log/nginx/laravel_access.log;
}

hosts文件末尾追加

127.0.0.1   mojito.test

浏览器打开:http://mojito.test/mojito#/admin/login

相关资料

mojito-文档
mojito-github

发表评论