Skip to content

一个通过create-react-app创建的集合vue的项目,用于vuereact-combined的demo

Notifications You must be signed in to change notification settings

devilwjp/vuereact-for-cra-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 17, 2021
160a73e · Sep 17, 2021

History

25 Commits
Sep 17, 2021
Sep 17, 2021
Nov 28, 2019
Sep 13, 2021
Aug 3, 2021
Dec 7, 2019
Dec 20, 2019
Dec 7, 2019
Nov 28, 2019
Dec 24, 2019
Sep 17, 2021
Sep 17, 2021

Repository files navigation

一个纯净的通过create-react-app创建的项目集成了vue

被用于VueReact(vuereact-combined)的demo用例
在线demo https://devilwjp.github.io/vuereact-for-cra-demo/build/index.html#/

demo项目的创造步骤日志

  • 通过create-react-app创建一个项目
  • 安装相关依赖
npm i vue vue-loader vue-template-compiler react-app-rewired vuereact-combined -S
  • 修改项目的启动命令(根据react-app-rewired官方说明)
/* package.json */
"scripts": {
   "start": "react-app-rewired start",
   "build": "react-app-rewired build",
   "test": "react-app-rewired test",
}
  • 在根目创建config-overrides.js
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = function override(config, env) {
    config.module.rules[2].oneOf[7].exclude.push(/\.vue$/)
    config.module.rules.unshift({ // add vue-loader
        test: /\.vue$/,
        loader: 'vue-loader',
    })
    config.plugins.unshift(new VueLoaderPlugin())
    return config;
};

About

一个通过create-react-app创建的集合vue的项目,用于vuereact-combined的demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published