Skip to content

npm module should export something useful #565

@bugeats

Description

@bugeats

Right now the npm module will install the css files in ./build, which is nice, but the module itself doesn't do anything.

If you are working on a node project that depends on purecss, there is no stable way to access the built files. npm v3 does not place the files in a predictable place. You can't reliably fs.readFileSync('node_modules/purecss/build/pure.css').

I suggest creating a basic index.js file that would export fully qualified paths to the built files. Example:

const purecss = require('purecss');

purecss.getFilePath('pure-min.css'); // "/foo/system/node_modules/purecss/build/pure-min.css"

You could also have the module export buffers of the file contents.

I went to implement a PR on this myself, but it wasn't clear how the contents of the published npm package is constructed. npm run prelease doesn't do what I expected. Might want to update docs about that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions