Skip to content

Commit

Permalink
feat: add search build to build
Browse files Browse the repository at this point in the history
  • Loading branch information
artmsilva committed Apr 4, 2023
1 parent 1b5f03d commit cddf8c0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions components/search/getProcessedModule.js
@@ -0,0 +1,23 @@
const postCss = require("postcss");
const variables = require("postcss-css-variables");
const imports = require("postcss-import");
const combineMediaQuery = require("postcss-combine-media-query");
const cssnano = require("cssnano");

const plugins = [
imports,
combineMediaQuery,
cssnano({
preset: ["advanced", { reduceIdents: false }]
})
];

module.exports = function getProcessedModule(filePath) {
const withVars = `@import "${filePath}";`;
return postCss([...plugins, variables])
.process(withVars, {
from: "src/app.css",
to: "dest/app.css"
})
.then(res => res.css);
};

1 comment on commit cddf8c0

@vercel
Copy link

@vercel vercel bot commented on cddf8c0 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.