npm config set access public ————— 设置为公共库 rollup -c rollup.config.js —————— 生成dist 文件,这步报错提示不能使用import就在package 里加 "type": "module" npm publish —————— 发布 Vue2项目集成 1、引入依赖
"@chenddcoder/dd-vuefront": "1.0.0",
"pako": "^2.1.0",
"core-js": "^3.8.3",
"crypto-js": "^4.2.0",
"javascript-obfuscator": "^4.1.0",
"vue-cookies": "^1.8.3",
"js-beautify": "^1.15.1",
"prismjs": "^1.29.0",
"vue-markdown": "^2.2.4",
"vue-codemirror": "^4.0.6"
2、在main.js中引入组件
import VueCodemirror from "vue-codemirror"
import 'codemirror/lib/codemirror.css'
Vue.use(VueCodemirror)
import {OnlineVue} from '@chenddcoder/dd-vuefront'
import '@chenddcoder/dd-vuefront/dist/index.css'
import VueCookies from 'vue-cookies'
Vue.use(VueCookies)
Vue.use(OnlineVue)
<VueView />
<VueEditorView/>