【问题标题】:How to use Sass Eyeglass with Webpack?如何在 Webpack 中使用 Sass Eyeglass?
【发布时间】:2017-04-03 11:12:00
【问题描述】:

我想将Sass EyeglassWebpack 一起使用。我发现关于它的信息非常少,而且相当令人沮丧,因为我确信它可以做到。

有人用过成功吗?

【问题讨论】:

  • 你曾经让 Eyeglass 与 Webpack 一起工作吗?尝试做同样的事情......

标签: sass webpack eyeglass


【解决方案1】:

我设法让眼镜在最近的 webpack 中与 sass-loader 一起工作。

Eyeglass 为 sass 注入了自己的选项,您可以将其作为选项传递给 sass-loader:

[...]
{
    test: /\.scss$/,
    include: config.paths.assets,
    use: ExtractTextPlugin.extract({
      fallback: 'style',
      publicPath: '../',
      use: [
        `css?${sourceMapQueryStr}`,
        'postcss',
        `resolve-url?${sourceMapQueryStr}`,
        {
          loader: `sass?${sourceMapQueryStr}`,
          options: eyeglass({
              // sass options...
              includePaths: ['/share/scss/'],
              eyeglass: {
                // eyeglass options
              }
            })
        }
      ],
    }),
 },
 [...]

【讨论】:

    猜你喜欢
    • 2017-03-28
    • 2018-06-29
    • 2015-05-02
    • 2021-04-18
    • 1970-01-01
    • 2016-08-13
    • 1970-01-01
    • 2019-04-11
    • 1970-01-01
    相关资源
    最近更新 更多