Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

LESS files don't get created as modules in the output Javascript file #41

@samirotiv

Description

@samirotiv

Hi,

I have turned on modules: True in my brunch.config. Now, although CSS modules are created correctly for CSS files, the output of the less file is only the mapping of the name mangling. Modules are not created for the actual content of the LESS file.

brunch config:

exports.config = {
  // See http://brunch.io/#documentation for docs.
  files: {
    javascripts: {
      joinTo: {
        'vendor.js': /^node_modules/,
        'mobile.js': [/^app\/mobile/, /^app\/common/],
        'warroom.js': [/^app\/warroom/, /^app\/common/]
      },
      order: {
        after: [/\.html$/, /\.css$/]
      }
    },
    templates: {
      joinTo: {
        'mobile.js': [/^app\/mobile/, /^app\/common/],
        'warroom.js': [/^app\/warroom/, /^app\/common/], 
      }
    }
  },
  plugins: {
    css: {
      modules: true,
      cssModules: true
    }, 
    less: {
      modules: true,
      cssModules: true
    }
  }
};

Relevant snippet from warroom.js:

require.register("warroom/components/appComponent/app.component.less", function(exports, require, module) {
module.exports = {"pandafry":"_pandafry_c5j6n_1"};
});

app.component.less:

.pandafry {
  color: #beefad;
}

body {
  background-color: #bedead;
}

And there is no search match for beefad or bedead in warroom.js.

Whereas, CSS modules are correctly going into the output file warroom.js.

Example:

;require.register("warroom/components/dash-task/dash-task.component.css", function(exports, require, module) {
module.exports = "h1 {\n  background:black;\n  font-family: 'Times New Roman', Times, serif\n}"
});

Can somebody please help me find out what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions