Since quite some time there is this package tmeasday:check-npm-versions that allows to define an implicit npm package dependency to a Meteor package.
Use this package if you are writing an Atmosphere package that depends on a given npm package is installed at the app level of projects you are installed in.
Now I am writing a Meteor package, say me:my-package
and have a dependency to an npm package, say some-package
. This npm package requires me to import these styles manually.
The folder for that is located at some-package/style/main.less
.
I tried to import the file within the package but it can't be imported into my package's less file:
@import "some-package/style/main";
@import "{}/some-package/style/main";
@import "node_modules/some-package/style/main";
@import "{}/node_modules/some-package/style/main";
all throw the same error:
While processing files with less (for target web.browser):
packages/me:my-package/style.less:1: Unknown import: <one of the path's above>
The obvious reason here: a Meteor package usually requires me to add files via api.addFiles
but the package has no 'real dependency' to the npm package to import this file.
I could move the 'responsibility' of importing the styles to the application that will use 'me:my-package' because it will have to install the npm package, too.
Putting the following line into the css of the application that will use me:my-package
actually works:
@import "/node_modules/some-package/style/main.less";
But this would also force the app to install less or sass if the package uses it (as less in my case).
Somebody managed to solve this in a package-user-friendly way?