Skip to content

Releases: IndexXuan/vue-cli-plugin-vite

upgrade vite 2.6+ & fix process.env issue when development

12 Oct 03:33
Compare
Choose a tag to compare
  • vite 2.6+ offers Vue SFC template ts support.
  • fix window.process.env.XXX use before create.

Thanks to @ZenDay.

support unplugin-icons / add example for unplugin ecosystem.

15 Sep 02:27
Compare
Choose a tag to compare

unplugin-icons use ~icon/aaa/bbb while this ~ is not css-loader syntax and should not replaced it with empty string. this publish hack the alias regexp for ~ and make unplugin-icons works. Thanks @Akryum.

add example for unplugin ecosystem, unplugin and vue-cli-plugin-vite plays well in nature. very nice.

  module.exports = {
    lintOnSave: process.env.NODE_ENV !== 'production',
    devServer: {
      overlay: false,
    },
    configureWebpack: {
      plugins: [require('unplugin-icons/webpack')({ compiler: 'vue2' })],
    },
    pluginOptions: {
      vite: {
        disabledTypeChecker: true,
        plugins: [require('unplugin-icons/vite')({ compiler: 'vue2' })],
      },
    },
  }

support config file return function

11 Sep 02:40
Compare
Choose a tag to compare

ref: vue-cli #3499
support config file return function:

module.exports = {
  // config
}

or

module.exports = () => {
  return {
    // config
  }
}

improve find project config file error handler

11 Sep 02:19
Compare
Choose a tag to compare

this plugin will require vue.config.js for extra vite plugins merge. this release improve the error report of it.
something like TypeError/ReferenceError but slient when project don't have vue.config.js.

let vueConfig = {}
try {
  vueConfig = require(resolve(process.env.CLI_CONFIG_FILE || 'vue.config.js')) || {}
} catch (e) {
  // handle no vue.config.js
  if (e.code === 'MODULE_NOT_FOUND') {
    if (process.env.VITE_DEBUG) {
      console.error(chalk.redBright(e))
    }
  } else {
    console.error(chalk.redBright(e.stack ?? e))
  }
}

close: #38

css-loader and more vue-cli consistence

09 Aug 04:53
Compare
Choose a tag to compare
  • support assets without protocol, e.g. <img src="//p0.meituan.com/xxx.png" />
  • support ~public/path/to/use or ~/public/path/to/use
  • support @import '~@/styles/xxx'
  • support dynamic injected(prefixed) env, e.g. VUE_APP_ENV=staging yarn vite
  • inject process.env.BASE_URL like vue-cli

Add css-loader url resolve compat.

25 Jun 07:31
Compare
Choose a tag to compare

https://webpack.js.org/loaders/css-loader/#url

Now in Vue SFC, you can use ~@/assets/logo.png both in template block and style block.
~ will be ignore for vite and useful for css-loader.
Your code compat with vite and vue-cli. :)

Type Checker & Eslint Support

18 Jun 09:04
Compare
Choose a tag to compare

thanks to vite-plugin-checker & vite-plugin-eslint

  • vue-cli use fork-ts-checker-webpack-plugin(not support template block), vite-plugin-checker use vls, it is better. the errors overlay respect to devServer.overlay options.
  • vue-cli have lineOnSave options and we can infer and respect to it, vite-plugin-eslint like eslint-loader for webpack.

both vite-plugin-checker & vite-plugin-eslint working only for dev(serve) right now.

Finally fix the vue-router history-mode SPA fallback with html-template

First Stable Release - V1

08 May 10:59
Compare
Choose a tag to compare

vue-cli-plugin-vite is now v1.0.0 after rc1 ~ 6.

Compatible with css `~` prefix

22 Apr 07:29
Compare
Choose a tag to compare