Skip to content

Commit

Permalink
fix: css lit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jholt1 committed Aug 2, 2023
1 parent e0c445a commit 3c7aea2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/muon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"@open-wc/building-rollup": "3.0.1",
"@open-wc/building-rollup": "2.2.3",
"@open-wc/scoped-elements": "2.2.0",
"@rollup/plugin-alias": "5.0.0",
"@rollup/plugin-json": "6.0.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-node-resolve": "15.1.0",
"@rollup/plugin-replace": "5.0.2",
"@rollup/plugin-virtual": "3.0.1",
"@web/dev-server": "0.3.0",
Expand Down
16 changes: 11 additions & 5 deletions packages/muon/scripts/rollup-plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import postcssExtendRule from 'postcss-extend-rule';
import cssnanoPlugin from 'cssnano';
import litcssPlugin from 'rollup-plugin-lit-css';
import cssPlugin from 'rollup-plugin-import-css';
import resolve from '@rollup/plugin-node-resolve';
import { cleanup, getConfig, getDestination, createTokens, sourceFilesAnalyzer, getAliasPaths } from './utils/index.mjs';

import path from 'path';
Expand Down Expand Up @@ -156,14 +155,21 @@ export const serverPlugins = [
];

export const rollupPlugins = [
resolve({
moduleDirectories: ['node_modules', 'web_modules']
}),
buildTokensPlugin(),
aliasPlugin(aliasConfig),
replacePlugin(replaceConfig),
stylesPlugin(styleConfig),
litcssPlugin({ exclude: ['**/css/*.css', '**/dist/*.css', 'muon.min.css', '**/**/*.slotted.css'] }),
litcssPlugin({
exclude: ['**/css/*.css', '**/dist/*.css', 'muon.min.css', '**/**/*.slotted.css'],
transform: (css) => {
// TODO: find a way to not have to do this - find why css is being turned to a function and then a string
const regex = /css`([\s\S]*?)`/;
const match = css.match(regex);
const cssString = match?.[1];

return cssString || css;
}
}),
cssPlugin({
include: '**/**/*.slotted.css',
transform: (css) => {
Expand Down

0 comments on commit 3c7aea2

Please sign in to comment.