Skip to content

Commit

Permalink
Move PostCSS config into vite.config.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
Corb3nik committed Oct 27, 2024
1 parent 66cb4f4 commit 7a96eb8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 34 deletions.
15 changes: 0 additions & 15 deletions templates/frontend-vanilla/packages/frontend/postcss.config.js

This file was deleted.

18 changes: 16 additions & 2 deletions templates/frontend-vanilla/packages/frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { resolve } from "path";
import {defineConfig} from "vite";
import tailwindcss from "tailwindcss";
import prefixwrap from "postcss-prefixwrap";
import manifest from "../../manifest.json" with { type: "json" };

export default defineConfig({
plugins: [],
Expand All @@ -25,6 +28,17 @@ export default defineConfig({
},
],
},
define: { 'process.env.NODE_ENV': '"production"' }
});
define: { 'process.env.NODE_ENV': '"production"' },
css: {
postcss: {
plugins: [
// This plugin injects the necessary Tailwind classes
tailwindcss(),

// This plugin wraps the root element in a unique ID
// This is necessary to prevent styling conflicts between plugins
prefixwrap(`#plugin--${manifest.id}`),
],
},
},
});
15 changes: 0 additions & 15 deletions templates/frontend-vue/packages/frontend/postcss.config.js

This file was deleted.

18 changes: 16 additions & 2 deletions templates/frontend-vue/packages/frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { resolve } from "path";
import {defineConfig} from "vite";
import vue from "@vitejs/plugin-vue";
import tailwindcss from "tailwindcss";
import prefixwrap from "postcss-prefixwrap";
import manifest from "../../manifest.json" with { type: "json" };

export default defineConfig({
plugins: [
Expand Down Expand Up @@ -28,6 +31,17 @@ export default defineConfig({
},
],
},
define: { 'process.env.NODE_ENV': '"production"' }
});
define: { 'process.env.NODE_ENV': '"production"' },
css: {
postcss: {
plugins: [
// This plugin injects the necessary Tailwind classes
tailwindcss(),

// This plugin wraps the root element in a unique ID
// This is necessary to prevent styling conflicts between plugins
prefixwrap(`#plugin--${manifest.id}`),
],
},
},
});

0 comments on commit 7a96eb8

Please sign in to comment.