import { Config } from "@stencil/core";
import { sass } from "@stencil/sass";
import { postcss } from "@stencil/postcss";
import autoprefixer from "autoprefixer";
import postcssimport from "postcss-import";

export const config: Config = {
  namespace: "huds-lib",
  globalStyle: "src/global/styles.scss",
  plugins: [
    sass({
      injectGlobalPaths: ["src/global/styles.scss"]
    }),
    postcss({
      plugins: [
        postcssimport,
        autoprefixer({
          cascade: false
        })
      ]
    })
  ],
  outputTargets: [
    {
      type: "dist",
      copy: [{ src: "fonts", dest: "../fonts" }]
    },
    {
      type: "docs-readme",
      footer: "Helsinki University Design System"
    },
    {
      type: "www",
      serviceWorker: null, // disable service workers
      copy: [{ src: "fonts" }]
    }
  ]
};