diff --git a/package-lock.json b/package-lock.json index 7decec9b..3bfc59e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28869,11 +28869,11 @@ "version": "0.0.2-beta.33", "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", diff --git a/packages/muon/package.json b/packages/muon/package.json index b806fe66..1f318b9e 100644 --- a/packages/muon/package.json +++ b/packages/muon/package.json @@ -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", diff --git a/packages/muon/scripts/rollup-plugins.mjs b/packages/muon/scripts/rollup-plugins.mjs index 235bbe96..0dfbca73 100644 --- a/packages/muon/scripts/rollup-plugins.mjs +++ b/packages/muon/scripts/rollup-plugins.mjs @@ -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'; @@ -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) => {