Skip to content
Nathan Reid edited this page Jun 21, 2016 · 18 revisions

Package Options are set by creating a cssModules section in package.json. Here is a sample package.json:

{
  "name": "my-app-name",
  "version": "1.0.0",
  "dependencies": {
    "meteor-node-stubs": "^0.2.3"
  },
  "cssModules": {
    "option1": "setting",
    "option2": true,
    "option3": [ "a", "b" ]
  }  
}

Here is a list of the supported settings:

Property Default Value Available Values Description
extensions ['mss', 'm.css'] An array of file extensions Only the extensions included in this setting will be processed by the plugin.
enableSassCompilation ['scss', 'sass'] An array of file extensions, or false Only the extensions included in this setting will undergo Sass compilation. The extensions must also be included in the extensions property.
enableStylusCompilation ['styl', 'm.styl'] An array of file extensions, or false Only the extensions included in this setting will undergo Stylus compilation. The extensions must also be included in the extensions property.
ignorePaths [] An array of regular expression patterns (as strings) Files that match any of these patterns will be excluded from processing, for example use the following to exclude the entire node_modules folder: [ 'node_modules' ].
parser undefined The name of your PostCSS parser, if any. The value of this option will be require()d and passed to PostCSS. For more details, see [[Sugarss and other PostCSS parsers
passthroughPaths [] An array of regular expression patterns (as strings) Files that match any of these patterns will be passed through unchanged, for example use the following to exclude bootstrap anywhere in the project: [ 'bootstrap.css' ].
specificArchitecture 'web' Any valid archMatching string, or false Allows filtering the plugin to run on a specific architecture. By default the plugin runs on 'web' (client-side) only; to enable server-side processing as well, set the value to false. To enable server-side and disable client-side processing, set the value to 'os'.