Convert template and style to ES6 modules:
import style form './btn.scss';
import template form './btn.tpl';
console.log(style);
console.log(template);
Create scoped template and style:
import style form 'scoped!./btn.scss';
import template form 'scoped!./btn.tpl';
console.log(style);
console.log(template);
- style:
*.css
*.sass
*.scss
*.less
*.styl
- template:
*.tpl
*.html
*.jade
npm install --save-dev rollup-plugin-scoped
import { rollup } from 'rollup';
import scoped from 'rollup-plugin-scoped';
rollup({
entry: 'app.js',
plugins: [
scoped()
]
});
MIT