【问题标题】:laravel 5 how to compile elixir with template inside node_moduleslaravel 5 如何使用 node_modules 中的模板编译 elixir
【发布时间】:2016-06-20 12:55:07
【问题描述】:

我在我的应用程序上安装了https://github.com/puikinsh/gentelella,有没有办法将资产链接到 laravel elixir?

这是我的模板目录

Root
|-app/
|-node_module/
|   |-gentelella/ # -> this is my template
|-gulpfile.js
|-public/
// other laravel folders to follow.

./gulpfile.js 内部

var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss');
});

【问题讨论】:

  • 你目前在 gulpfile.js 中有什么?
  • 是的,我在根文件夹中,我还在 gentelella 文件夹中找到了一个 gulpfile.js。
  • 我的意思是作为代码,编辑您的帖子并添加来自 gulpfile.js 的 JS。
  • @TheFallen 我更新了我的帖子。

标签: laravel-5 gulp laravel-elixir


【解决方案1】:

试试这个:

elixir(function(mix) {
    mix.sass('app.scss');

    mix.styles([
        'node_modules/path/to/gentelella/css.css'
    ], 'public/css/app.css', './');

    mix.version('public/css/app.css');
});

【讨论】:

    猜你喜欢
    • 2015-09-14
    • 1970-01-01
    • 2015-05-11
    • 2016-11-16
    • 1970-01-01
    • 2015-04-30
    • 2016-03-05
    • 1970-01-01
    • 2017-07-19
    相关资源
    最近更新 更多