@@ -8,6 +8,10 @@ import copy from 'rollup-plugin-copy';
88import { indexHtml } from './src/indexHtml.js' ;
99import dev from 'rollup-plugin-dev' ;
1010import del from 'rollup-plugin-delete' ;
11+ // import postcss from 'rollup-plugin-postcss';
12+ import autoprefixer from 'autoprefixer' ;
13+ // import postcssLit from 'rollup-plugin-postcss-lit';
14+ import postcss from 'postcss' ;
1115
1216const extensions = [ '.js' , '.ts' ] ;
1317
@@ -22,7 +26,7 @@ const config = {
2226 format : 'es' ,
2327 name : 'Oriole' ,
2428 entryFileNames : '[name].[hash].js' ,
25- chunkFileNames : '[hash].js' ,
29+ chunkFileNames : '[name].[ hash].js' ,
2630 } ,
2731
2832 plugins : [
@@ -34,6 +38,59 @@ const config = {
3438 copy ( copyConfig ) ,
3539 resolve ( { extensions } ) ,
3640 commonjs ( ) ,
41+ // {
42+ // name: 'lit-css-fix',
43+ // async transform(code, id) {
44+ // let finCode = `${code}`;
45+ // let slicedCode = finCode;
46+ // const cssBits = [...((code || '').matchAll(/css`.*?`/g) || [])];
47+ // if (cssBits.length < 1) return null;
48+
49+ // let indexCorrection = 0;
50+ // const processor = postcss([autoprefixer()]);
51+ // /** @type {RegExpExecArray } */
52+ // let all = '';
53+ // let counter = 0;
54+ // while (
55+ // (all = /css`.*?`/g.exec(slicedCode)) !== null &&
56+ // all[0].length > 5 &&
57+ // counter < 20
58+ // ) {
59+ // let bit = all[0],
60+ // index = all.index;
61+ // let bitStr = bit.replace('css`', '');
62+ // bitStr = bitStr.replace('`', '');
63+ // var finBit = await processor.process(bitStr, { from: undefined });
64+ // const correctedIndex = indexCorrection + index;
65+ // finCode = finCode.slice(0, correctedIndex) + 'css`';
66+ // finBit.css + '`' + finCode.slice(correctedIndex);
67+ // indexCorrection = indexCorrection + finBit.css.length;
68+ // console.log(indexCorrection);
69+ // slicedCode = slicedCode.slice(indexCorrection + 4);
70+ // counter++;
71+ // }
72+
73+ // for (const all of cssBits) {
74+ // let bit = all[0],
75+ // index = all.index;
76+ // let bitStr = bit.replace('css`', '');
77+ // bitStr = bitStr.replace('`', '');
78+ // var finBit = await processor.process(bitStr, { from: undefined });
79+ // const correctedIndex = indexCorrection + index;
80+ // finCode =
81+ // finCode.slice(0, correctedIndex) +
82+ // finBit.css +
83+ // finCode.slice(correctedIndex);
84+ // indexCorrection += bit.length - finBit.css.length;
85+ // }
86+ // console.log(finCode);
87+
88+ // return {
89+ // code: finCode,
90+ // map: null,
91+ // };
92+ // },
93+ // },
3794 babel ( {
3895 extensions,
3996 babelHelpers : 'bundled' ,
0 commit comments