Create a rollup.config.js configuration file and import the plugin:import { litCss } from 'rollup-plugin-css-lit' export default { input: 'src/index.js', output: { file: 'dist/main.js', format: 'iife', sourcemap: true }, plugins: [ litCss({ minify: process.env.NODE_ENV === '...
rollup-plugin-lit-css Rollup plugin to import css files as lit-element tagged css objects. Do I Need This? No. This is an optional package who's sole purpose is to make it easier to write CSS-in-CSS while working on lit-element projects. You can just as easily write your CSS in ...
将tailwindcss v3 编译的 CSS 注入 Lit 组件中。 npm install --save rollup-plugin-lit-tailwindcss3 Requirements Lit v2.0 and later Tailwindcss v3.0 and later Usage rollup.config.js importlitTailwindfrom"rollup-plugin-lit-tailwindcss3";exportdefault{input:"src/index.ts",output:{dir:"dist",},p...
importstylesfrom'index.css';@customElement('my-element')classOneextendsLitElement{staticstyles=[styles];render(){returnhtml`Hello`;}} Suggest using@rollup/plugin-aliasto shorten import paths. import{fileURLToPath}from'node:url';import{dirname,resolve}from'node:path';const__filename=fileURLToPath...
import litTailwind from 'rollup-plugin-lit-tailwindcss'; export default { input: 'src/index.ts', output: { dir: 'dist', }, plugins: [ litTailwind({ include: 'src/components/**/*.ts', placeholder: 'tw_placeholder', placeholder: undefined, }), ], };Then...
rollup.config.js import tailwindcss from 'rollup-plugin-tailwindcss-lit'; export default { ... plugins: [tailwindcss()], }; import styles from 'index.css'; @customElement('my-element') class One extends LitElement { static styles = [styles]; render() { return html`Hello`; } } Sugge...