Skip to content
This repository has been 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

Open
samirotiv opened this issue Dec 26, 2016 · 1 comment
Open

Comments

@samirotiv
Copy link

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?

@samirotiv samirotiv changed the title LESS files don't get created as modules in the JS LESS files don't get created as modules in the output Javascript file Dec 26, 2016
@denysdovhan
Copy link
Contributor

@samirotiv hey, thanks for reporting! Let's see how can I solve your problem.

Could you, please, provide me a GitHub repo that reproduce your problem? That would help me a lot.

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

No branches or pull requests

2 participants