Closed bcomnes closed 9 years ago
Hi @bcomnes, to get it to compile with parcelify using vanilla css you'll need an empty "index.js" file, and to require that file via javascript. i.e
require( 'my-css-module' )
where you have an empty js file in
node_modules/my-css-module/index.js
It is not the most straight forward approach for this use case but it follows naturally from parcelify's paradigm of keeping the dependency graph just in javascript instead of having parallel graphs for each asset type. Two other approaches are
<style>
taginclude
the reset css. If you want the reset css in a separate node module, you can use parcelify-import-resolver as described in the docs of that repo.Hope that helps. Closing for now, let us know if that does not resolve your issue.
Cool! Makes total sense. Still trying to understand the state of npm + css and this is a very cool approach!
I'm trying to understand how to set up a package.json for a css reset module that isn't associated with any requireable javascript, and allow it to be consumed by parcelify.
I have a
"style": "dist/sanitize.css",
field, but have omitted amain
field and have noindex.js/json
. There is a gulp file which is used to build the consumable css file and is specified through npm scripts. It just didn't seem like there is a use for amain
field in this case. Will this be enough for parcelify to use this module in a bundle somehow?