zouhir / jarvis

A very intelligent browser based Webpack dashboard
5.44k stars 191 forks source link

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

Open azulkipli opened 6 years ago

azulkipli commented 6 years ago

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 commented 6 years ago

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*/ });
};