amireh / happypack

Happiness in the form of faster webpack build times.
MIT License
4.23k stars 124 forks source link

not support SASS-LOADER implementation #256

Open weilinzung opened 5 years ago

weilinzung commented 5 years ago
{
    loader: 'sass-loader', 
    options: {
      sourceMap: true,
      implementation: require('sass'),
    }
}
Module build failed (from ../node_modules/sass-loader/lib/loader.js):
TypeError: Cannot read property 'bind' of undefined
    at getRenderFuncFromSassImpl (.../node_modules/sass-loader/lib/loader.js:105:30)
    at Object.sassLoader (.../node_modules/sass-loader/lib/loader.js:46:20)
DemonCloud commented 4 years ago

Expected Behavior

sass-loader 7.3.1 work correct!

build success as sass-loader 7.3.1 version with mini-css-extract-plugin && HappyPack

Actual Behavior

get Error working with mini-css-extract-plugin and HappyPack

Code

webpack mode production

// webpack.config.js
   // use loader
      {
        test: /\.(css|scss)$/,
        use: [
          MiniCssExtractPlugin.loader,
          require.resolve('happypack/loader') + '?id=scss',
        ],
      }

// HappyPack
    new HappyPack({
      id: 'scss',
      threadPool: HappyThreadPool,
      loaders: [
            {
              loader: require.resolve('css-loader'),
              options: {
                sourceMap: true,
                modules: abcJSON.css ? !!abcJSON.css.modules : false,
                importLoaders: 2,
              },
            },
            {
              loader: require.resolve('postcss-loader'),
              options: {
                sourceMap: 'inline',
                config: {
                  path: path.join(__dirname, '/'),
                },
              },
            },
       {
          loader: require.resolve('resolve-url-loader'),
          options: {
            sourceMap: true,
          },
        },
        {
          loader: require.resolve('sass-loader'),
          options: {
            sourceMap: true
          },
        },
      ],
    }),
Screen Shot 2019-08-30 at 1 14 08 PM
shinelp100 commented 4 years ago

I have the same problem, Can anyone fix it?

webfrontzhifei commented 3 years ago

have you fixed it?

sujianqingfeng commented 1 year ago

I encountered this problem, upgrade Vue-loader vue template-compiler version