xiaofuzi / rollup-plugin-less

a less rollup plugin
22 stars 23 forks source link

Not work when the less file not list in rollup's input option. #28

Open vipcxj opened 5 years ago

vipcxj commented 5 years ago

this is my rollup.config.js

export default {
    input: 'src/index.ts',
    output: [
        { file: 'dist/index.js', format: 'cjs' },
    ],
    plugins: [
        ...
        less({
            output: 'dist/index.css',
            include: 'src/index.less',
        })
    ]
}

no index.css is generated.

raybooysen commented 5 years ago

What does your index.ts look like?

vipcxj commented 5 years ago

@raybooysen Adding import './xxx.ess' to the index.ts, and then work. But I don't know whether it has a side effect. Because I am writing a library, and I want the library user import the css or less themselvies. So the style file should not be imported by my library automatically.

raybooysen commented 5 years ago

I don't think it has an impact. If you look at your transpiled code, there is no reference to the less.