Skip to content

Commit

Permalink
wip: Dedupe CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Nov 29, 2022
1 parent 0f280b8 commit feededc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/design-system/src/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@
@import "theme/oc-visibility";
@import "theme/oc-width";
@import "theme/tooltip";

/* SHITTY MARKER */
2 changes: 2 additions & 0 deletions packages/web-runtime/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
</div>
</template>
<script lang="ts">
import '../../design-system/src/styles/styles.scss'
import { mapGetters, mapState, mapActions } from 'vuex'
import SkipTo from './components/SkipTo.vue'
import LayoutApplication from './layouts/Application.vue'
Expand Down
12 changes: 12 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ const __filename = fileURLToPath(import.meta.url)
const projectRootDir = dirname(__filename)

const plugins = [
{
transform(src, id) {
if (id.includes('rollup-plugin-vue=styles')) {
const split = src.split('/* SHITTY MARKER */')
const newSrc = split[split.length-1]
return {
code: newSrc,
map: null
}
}
}
},
postcss({
extract: path.join('css', 'web.css'),
minimize: production,
Expand Down

0 comments on commit feededc

Please sign in to comment.