Skip to content

Commit

Permalink
fix: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterAlfredLee committed Aug 10, 2021
1 parent ec13f7e commit 0a32ea4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 2 additions & 7 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,12 @@ webpack-to-vite -d <project path>
> Vue-CLI转换是将`vue.config.js`中的配置,转换后设置到`vite.config.js`
* ✅ V01: public path环境变量

* `process.env.PUBLIC_URL``publicPath``baseUrl` -> `base`
* `process.env.PUBLIC_URL``publicPath``baseUrl` -> `base`

* ✅ V02: css配置
* `css.loaderOptions` -> `css.preprocessorOptions`

* `css.loaderOptions.less.lessOptions.modifyVars` -> `css.preprocessorOptions.less.modifyVars`

* 如果在项目中对`css.loaderOptions.sass`进行了配置,则`css.preprocessorOptions.sass``css.preprocessorOptions.sass`也会进行相应的转换。

在vue-cli中,`sass`配置可以同时影响`sass``scss`,而在vite中需要对它们进行单独配置
* 在Vue-CLI中,`sass`配置可以同时影响`sass``scss`,而在vite中需要对它们进行单独配置。因此,如果在Vue-CLI中只进行了`css.loaderOptions.sass`配置,在vite中也会生成`css.preprocessorOptions.sass``css.preprocessorOptions.scss`两个配置;而如果在Vue-CLI中只进行了`css.loaderOptions.scss`配置,在vite中则只会生成`css.preprocessorOptions.scss`配置

* ✅ V03: server配置
* 默认添加`server.strictPort = false`配置
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ Legend of annotations:
* ✅ V02: css options
* `css.loaderOptions` -> `css.preprocessorOptions`
* `css.loaderOptions.less.lessOptions.modifyVars` -> `css.preprocessorOptions.less.modifyVars`
* with only `css.loaderOptions.sass` option is set, it will be converted to `css.preprocessorOptions.sass` and `css.preprocessorOptions.sass`.
The `sass` configuration influence both `sass` and `scss` in Vue-CLI while vite need to configure them respectively
* The `sass` configuration will influence both `sass` and `scss` in Vue-CLI, but in vite we need to configure them respectively.
So with only `css.loaderOptions.sass` option is set in Vue-CLI, it will be converted to `css.preprocessorOptions.sass` and `css.preprocessorOptions.scss`.
On the other hand, with only `css.loaderOptions.scss` option is set in Vue-CLI, it will be converted to `css.preprocessorOptions.scss`.

* ✅ V03: server options
* `server.strictPort = false` is set by default
* `process.env.PORT` or `devServer.port` -> `server.port`
Expand Down

0 comments on commit 0a32ea4

Please sign in to comment.