nwb icon indicating copy to clipboard operation
nwb copied to clipboard

custom webpack rule for sass processing error

Open ewingrj opened this issue 5 years ago • 0 comments

This issue is a:

  • Question / support request

What is the correct way to have a custom sass rule so I can use the resolve-url-loader?

It appears in the docs that I can use the default nwb loader configs in a custom rule...

I have tried the following config, but get an error: Error: No PostCSS Config found in:

 extra: {
      output: {
        filename: '[name].bundle.js',
      },
      module: {
        rules: [
          {
            test: /\.s[ac]ss$/,
            use: [
              {
                'loader': 'mini-css-extract-plugin/dist/loader.js',
              },
              {
                loader: 'css-loader',
                options: {
                  'importLoaders': 1,
                },
              },
              {
                loader: 'postcss-loader',
                options: {
                },
              },
              {loader: 'resolve-url-loader',},
              {
                loader: 'sass-loader',
                options: {
                  // This allows us to resolve node_modules w/o a ~ prefix, and
                  // allows us to import these files w/ django_sass_processor
                  includePaths: [path.resolve(__dirname, './node_modules')],
                },
              },
            ],
          },
        ],
      },

It would be great to be able to configure the nwb-sass plugin to use the resolve-url-loader if possible. insin/nwb-sass#3

ewingrj avatar Apr 22 '19 21:04 ewingrj