rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
Use @import (reference) '~moduleName/file.less'
I import npm modules from a monorepo, which uses the syntax "@import (reference) '~moduleName/less/vaiables.less' to import less variables. But when I try to build, i get the (postcss plugin) Error: '~moduleName/less/variables' wasn't found."
I see the ~ is available for sass files, but it is not for less files? Or is there some config I can set to make this work?
the same question
The same question
@frodehansen2 have you solve the question?
you can figure out like this:
import NpmImport from 'less-plugin-npm-import'; import postcss from 'rollup-plugin-postcss';
export default { ...... plugins: [ postcss({ use: [['less', { plugins: [new NpmImport({prefix: '~'})], }]], }), ] }