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

How to use it with preact-cli preact.config.js ? #132

Open
azulkipli opened this issue Mar 29, 2018 · 1 comment
Open

How to use it with preact-cli preact.config.js ? #132

azulkipli opened this issue Mar 29, 2018 · 1 comment

Comments

@azulkipli
Copy link

azulkipli commented Mar 29, 2018

In preact.config.js I already have

import criticalCssPlugin from "preact-cli-plugin-critical-css";
import Jarvis from "webpack-jarvis";
/* the rest of your webpack configs */

export default (config, env) => {
  const options = {
    // Passed directly to the 'critical' module (this is optional)
  };

  criticalCssPlugin(config, env, options);
};

Thanks

@lukeed
Copy link
Collaborator

lukeed commented Mar 29, 2018

Hey, you can modify the config first before passing it into criticalCssPlugin:

const Jarvis = require("webpack-jarvis");
const critical = require("preact-cli-plugin-critical-css");

module.exports = (config, env) => {
  config.plugins.push(
    new Jarvis({ /*jarvis options*/ })
  );

  critical(config, env, { /*critical options*/ });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants