Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate CSS on hot-reload #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ To run the project locally, use:
If you're running your project locally, follow these steps to update your environment variables:

1. Save your changes in the `.env` file.
2. Run `pnpm dev` again to apply the updated environment variables.
3. Reload the page to reflect the changes.

### Deployed on Vercel

Expand All @@ -68,4 +66,4 @@ If you have deployed your project on Vercel, follow these steps to update your e
3. Update the environment variables in the Vercel dashboard.
4. Trigger a redeployment of your app to apply the changes.

By following these steps, you can ensure that your project uses the updated environment variables.
By following these steps, you can ensure that your project uses the updated environment variables.
38 changes: 37 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
/** @type {import('next').NextConfig} */

const execSync = require("child_process").execSync;

const nextConfig = {
images: { domains: ["arweave.net", 'image-cache-service-z3w7d7dnea-ew.a.run.app'] },
images: {
domains: ["arweave.net", "image-cache-service-z3w7d7dnea-ew.a.run.app"],
},

webpack: (config, { isServer, webpack }) => {
if (!isServer) {
config.plugins.push(
new webpack.WatchIgnorePlugin({
paths: [/.*/], // This tells webpack to not ignore any files. Modify to suit your needs.
})
);

config.plugins.push(
new webpack.HotModuleReplacementPlugin({
multiStep: true,
})
);

config.plugins.push({
apply: (compiler) => {
compiler.hooks.watchRun.tapAsync(
"MyCustomScript",
(compilation, callback) => {
// Run your custom script
execSync("node generate-css.js", { stdio: "inherit" });

callback();
}
);
},
});
}

return config;
},
};

module.exports = nextConfig;