// import vueLoader from "vue-loader";
// console.log(vueLoader);
// import VueLoaderPlugin from "vue-loader/lib/plugin";
export default {
  env: {
    BASE_URL: process.env.BASE_URL,
    NODE_ENV: process.env.NODE_ENV,
  },
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: "《欢迎来到梦乐园》官网预约开启-星线网络",
    htmlAttrs: {
      lang: "en",
    },
    meta: [
      { charset: "utf-8" },
      {
        name: "viewport",
        content:
          "width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no",
      },
      {
        hid: "keywords",
        name: "newk",
        content: "欢迎来到梦乐园,梦乐园,星线网络",
      },
      {
        hid: "description",
        name: "description",
        content:
          "《欢迎来到梦乐园》是星线网络的第一款女性向轻喜剧异界冒险经营手游。本作中玩家将作为一名乐园管理者,去大陆的各个国家游历冒险,收集失窃散落的真理之书残页,以重现乐园往昔的繁华,恢复乐园的生机与活力。在此过程中,您还将结识许多性格各异的朋友,收获真挚的友谊。这一切都将留给您在接下来的异世界冒险之旅中逐一解锁,相信在不久的将来您将体验到无与伦比的乐趣。欢迎来到梦乐园,梦幻与魔法永不落幕!",
      },
      { name: "format-detection", content: "telephone=no" },
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/logo.png" }],
    script: [
      { src: "/js/flexible.js", type: "text/javascript", charset: "utf-8" },
    ],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    {
      src: "~/plugins/vueSwiper.js",
      ssr: false,
    },
    { src: "~plugins/vueLazyLoad.js", ssr: false },
    // new VueLoaderPlugin(),
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: ["@nuxtjs/eslint-module"],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: ["cookie-universal-nuxt"],
  router: {
    // 在每页渲染前运行 middleware、middleware.js 中间件的逻辑
    middleware: "middleware",
  },
  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    // vendor: ["axios"],
    postcss: {
      analyze: true,
      plugins: {
        "postcss-url": false,
        "postcss-px2rem": {
          remUnit: 100,
        },
      },
      preset: {
        autoprefixer: {
          grid: true,
        },
      },
    },

    // extend(config, { isDev }) {
    // const vueLoader = config.module.rules.find(
    //   (loader) => loader.loader === "vue-loader"
    // );
    // /* 把audio标签在编译时转成src属性 */
    // vueLoader.options.transformAssetUrls = {
    //   audio: "src",
    // };
    // // /* 对mp3等格式的文件用url-loader进行处理 */
    // config.module.rules.push({
    //   test: /\.(ogg|mp3|wav|mpe?g)$/i,
    //   loader: "url-loader",
    //   options: {
    //     transformAssetUrls: {
    //       source: "src",
    //     },
    //     name: "[path][name].[ext]",
    //   },
    // });
    // if (isDev && isClient) {
    //   config.module.rules.push({
    //     enforce: "pre",
    //     test: /\.(js|vue)$/,
    //     loader: "eslint-loader",
    //     exclude: /(node_modules)/,
    //   });
    // }
    // },
  },
};