rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
Less Import Prefix
Can you add support to import module .less files with the prefix ~
like all the other bundles already do? Looks like this is already supported for sass, but why not less?
imports
For Sass/Scss Only.
Similar to how webpack's sass-loader works, you can prepend the path with ~ to tell this plugin to resolve in node_modules:
@import "~bootstrap/dist/css/bootstrap";
For example the error I'm seeing is similar to:
[!] (postcss plugin) Error: '~my-package/lib/less/spinner.less' wasn't found.
Thanks.
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: '~'})],
}]],
}),
]
}
Sweet, thanks!
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: '~'})], }]], }), ] }
working for me. Thank you