Rollup mô-đun css bản thảo
Ngày đăng:
08/12/2022
Trả lời:
0
Lượt xem:
183
rollup-plugin-postcss-mô-đun
Sử dụng tùy chọn import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }5 để chuyển tùy chọn cho plugin import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }6 Với import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }7 2. 0, lợi thế tiếp tục duy nhất mà cái này có là hỗ trợ TypeScript Một tùy chọn mới tồn tại
Ngoài ra, tùy chọn import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }2 mặc định hơi khác một chút
Thí dụxem ở đây để biết một repo có thể sao chép import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }4 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], } import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }5 ________số 8 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }6 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }0 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }7 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }2 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }8 import postcss from 'rollup-plugin-postcss-modules' import typescript from 'rollup-plugin-typescript2' import autoprefixer from 'autoprefixer' export default { entry: 'src/index.tsx', dest: 'dist/bundle.js', format: 'iife', plugins: [ postcss({ extract: true, // extracts to `${basename(dest)}.css` plugins: [autoprefixer()], writeDefinitions: true, // modules: { .. } }), typescript(), ], }4 |