1

I am trying to get a Snowpack project setup where I need to use a Copy Plugin. I am trying to use copy-webpack-plugin but I am confused if we can use packages like this within the Snowpack config.

/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
  mount: {
    root: {
      url: "/"
    },
    /* Virtual dir path mapped to src */
    src: "/dist",
  },
  plugins: [
    ["@snowpack/plugin-webpack", {
      htmlMinifierOptions: false,
    }],
    ["copy-webpack-plugin", {
      /* patterns... */
    }]
  ],
  optimize: {
    /* ... */
  },
  packageOptions: {
    /* ... */
  },
  devOptions: {
    /* ... */
  },
  buildOptions: {
    /* ... */
  },
};

Returns error: [snowpack] TypeError: Class constructor CopyPlugin cannot be invoked without 'new'
TypeError: Class constructor CopyPlugin cannot be invoked without 'new'

I can't seem to find any examples of using packages like this in Snowpack. Is this possible or do I need to stay with Webpack?

Mike
  • 401
  • 6
  • 12

0 Answers0