-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Styles Generator: Install
postcss-url
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in an error. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
- Loading branch information
1 parent
e8eb46a
commit 867e034
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('postcss-import'), | ||
require('postcss-nesting'), | ||
require('autoprefixer'), | ||
require('postcss-url')({ | ||
url: 'copy', | ||
assetsPath: 'static' | ||
}) | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('postcss-import'), | ||
require('postcss-nesting'), | ||
require('autoprefixer'), | ||
require('postcss-url')({ | ||
url: 'copy', | ||
assetsPath: 'app/assets/static' | ||
}) | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters