From ec16b20a326635747f6197bf394eb0f76b25f3a2 Mon Sep 17 00:00:00 2001 From: Andres Riofrio Date: Wed, 22 Apr 2015 23:50:11 -0700 Subject: [PATCH 1/2] Support "main" for compatibility with Bower --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 66b9d73..f84e365 100644 --- a/index.js +++ b/index.js @@ -89,7 +89,7 @@ function reworkNPM(opts) { function processPackage(pkg) { pkg.main = (hasOwn(shim, pkg.name) && shim[pkg.name]) || - pkg.style || 'index.css'; + pkg.style || pkg.main || 'index.css'; return pkg; } From 8b4affa9cb2c6db9570e0c518e63834645f62602 Mon Sep 17 00:00:00 2001 From: Andres Riofrio Date: Wed, 22 Apr 2015 23:51:19 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a54e5ce..646ee24 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Import CSS styles from NPM modules using [rework](https://github.com/reworkcss/rework). This lets you use `@import` CSS using the same rules you use for `require` in -Node. Specify the CSS file for a module using the `style` field in +Node. Specify the CSS file for a module using the `style` or `main` field in `package.json` and use `@import "my-module";`, or specify the file name in the module, like `@import "my-module/my-file";`. You can also require files relative to the current file using `@import "./my-file";`.