Skip to content

Commit

Permalink
fix(style): remove excess styles from bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Apr 4, 2024
1 parent ccf5a14 commit 4fbf3ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/delivery-options/skip-scss-plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {type Plugin} from 'vite';

export const skipScssPlugin = (): Plugin => ({
name: 'skip-scss',
transform(_, id) {
if (id.endsWith('.scss')) {
return '';
}

return null;
},
});
2 changes: 2 additions & 0 deletions apps/delivery-options/vite-myparcel-lib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import dts from 'vite-plugin-dts';
import {mergeConfig, type UserConfig} from 'vite';
import {createViteConfig} from '@myparcel-do/build-vite';
import baseConfig from './vite.config';
import {skipScssPlugin} from './skip-scss-plugin';
import {getSharedConfig, createFilenameFormatter} from './private';

export default createViteConfig((env) => {
const isProd = env.mode === 'production';

return mergeConfig(baseConfig(env), {
plugins: [
skipScssPlugin(),
isProd &&
dts({
entryRoot: 'src',
Expand Down
3 changes: 3 additions & 0 deletions apps/delivery-options/vite-myparcel.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import {mergeConfig, type UserConfig} from 'vite';
import {createViteConfig} from '@myparcel-do/build-vite';
import baseConfig from './vite.config';
import {skipScssPlugin} from './skip-scss-plugin';
import {getSharedConfig, createFilenameFormatter} from './private';

export default createViteConfig((env) => {
return mergeConfig(baseConfig(env), {
plugins: [skipScssPlugin()],

build: {
emptyOutDir: false,
lib: {
Expand Down

0 comments on commit 4fbf3ba

Please sign in to comment.