Metronic Laravel 整合

Metronic Laravel Integration

我正在尝试将 metronic 主题整合到我现有的 laravel 项目中。我在 Laravel 宅基地工作。

我一一执行了“https://keenthemes.com/metronic/?page=docs&section=laravel-integration”link中的步骤,没有出现任何错误。然而, /laravel/public/js/app.js/laravel/public/js/app.css 文件并没有出现第 6 步 没有发生。这可能是什么原因?

我的webpack.mix.js文件内容:

const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/call.js', 'public/js');
mix.js('resources/js/echo.js', 'public/js');

// copy images folder into laravel public folder
mix.copyDirectory('resources/demo1/src/assets/media', 'public/assets/media');

/**
* plugins specific issue workaround for webpack
* @see https://github.com/morrisjs/morris.js/issues/697
* @see 
*/
mix.webpackConfig({
   resolve: {
       alias: {
           'morris.js': 'morris.js/morris.js',
           'jquery-ui': 'jquery-ui',
       },
   },
});

您忘记编译sass和步骤4中提到的js文件。

将以下内容添加到您的 webpack.mix.js

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

要解决 bootstrap 的问题,您必须确保导入路径正确:

更改 resources/demo1/src/assets/sass/style.scss 中的以下内容:

import 'bootstrap/scss/bootstrap';

import '~bootstrap/scss/bootstrap';