Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems wanting to install less-loader #64

Open
Mubra opened this issue Jan 16, 2020 · 0 comments
Open

problems wanting to install less-loader #64

Mubra opened this issue Jan 16, 2020 · 0 comments

Comments

@Mubra
Copy link
Member

Mubra commented Jan 16, 2020

I have a theme for plone with .less files, my configuration is this:

const makeConfig = require('sc-recipe-staticresources');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const SpritesmithPlugin = require('webpack-spritesmith');

let data = makeConfig(
  // name
  'sct.elmirador',

  // shortName
  'elmirador',

  // path
  //`${__dirname}/dist`,
  // `${__dirname}/../src/sct/elmirador/browser/static`,
  `${__dirname}/../src/sct/elmirador/theme/elmirador-theme`,

  //publicPath
  //'',
  '++resource++sct.elmirador/',
  // '++theme++sct.elmirador/',

  //callback
  (config, options) => {
  config.entry.unshift(
        `./app/elmirador.less`,
      );
  },
);

data.module.rules.push(      {
        test: /\.less$/,
        use: [ 
                    'style-loader',
                    'css-loader', 
                    'less-loader'
                ],// compiles Less to CSS
      },);

module.exports = data;
console.log(module.exports.module.rules);

I get this:

Version: webpack 3.12.0
Time: 968ms
        Asset       Size  Chunks             Chunk Names
elmirador-.js  907 bytes       0  [emitted]  main
   index.html  556 bytes          [emitted]  
 resources.pt  114 bytes          [emitted]  
   [0] multi ./app/elmirador.less ./app/elmirador.js 40 bytes {0} [built]
   [1] ./app/elmirador.js 261 bytes {0} [built]
   [2] ./app/js/filea.js 170 bytes {0} [built]

ERROR in multi ./app/elmirador.less ./app/elmirador.js
Module not found: Error: Can't resolve 'less-loader' in '/home/mubra/elmirador/elmirador/webpack'
 @ multi ./app/elmirador.less ./app/elmirador.js

when I run "npm install less-loader" webpack breaks

in short, I don't know if you can configure this version of webpack to use less files instead of scss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant