3. 恢复默认vue目录(helloworld of vue + electron)

恢复默认vue目录

恢复vue-cli默认生成的目录结构

接上一篇:
2.helloworld 添加常用插件(helloworld of vue + electron)

1. 恢复原因

在初始搭建项目时,将vue-cli生成的目录结构做了更改,给自己挖了不少坑,虽然一个个填了,
但考虑利弊,觉得还是恢复可能会好些。这真是差点走远了,玩也玩过了,该回头了。

2. 开始恢复

2.1. 把renderer下的目录和文件移动到src目录

  (use "git checkout -- ..." to discard changes in working directory)

        modified:   README.md
        deleted:    src/renderer/App.vue
        deleted:    src/renderer/assets/logo.png
        deleted:    src/renderer/components/HelloWorld.vue
        deleted:    src/renderer/main.js
        deleted:    src/renderer/router.js
        deleted:    src/renderer/store.js
        deleted:    src/renderer/views/About.vue
        deleted:    src/renderer/views/Home.vue
        modified:   vue.config.js

Untracked files:
  (use "git add ..." to include in what will be committed)

        "docs/3.\346\201\242\345\244\215vue\347\233\256\345\275\225.md"
        src/App.vue
        src/assets/
        src/components/
        src/main.js
        src/router.js
        src/store.js
        src/views/

no changes added to commit (use "git add" and/or "git commit -a")

2.2. 移除vue.config.js里的configureWebpack字段

-const path = require('path')
-
 module.exports = {
-  configureWebpack: {
-    entry: {
-      app: './src/renderer/main.js'
-    },
-    resolve: {
-      alias: {
-        '@': path.join(__dirname, 'src/renderer')
-      },
-      extensions: ['.js', '.vue', '.json', '.css', '.node']
-    },
-    target: 'electron-renderer'
-  },
   publicPath: process.env.NODE_ENV === 'production'
     ? './'
     : './'

项目地址https://github.com/nononoone/helloworld

你可能感兴趣的:(3. 恢复默认vue目录(helloworld of vue + electron))