Vuejs 使用介绍技术专题与文档汇总,系统梳理 vue、vuejs 核心概念、架构原理、实战配置与开发指南。
安装
npm i -g @vue/cli创建项目
vue create <name>
cd <name>
npm run serve运行
基于 Vue CLI 的项目:
npm install
npm run serve
# 生产打包
npm run build如果是基于 Vite 的现代 Vue 项目:
npm install
npm run dev
# 生产打包
npm run build插件
开发插件 vue-devtools
https://github.com/vuejs/vue-devtools
clean-webpack-plugin
Installation, in webpack project home dir:
npm install --save-dev clean-webpack-pluginUsage, add to webpack.config.js:
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpackConfig = {
plugins: [
/**
* All files inside webpack's output.path directory will be removed once, but the
* directory itself will not be. If using webpack 4+'s default configuration,
* everything under <PROJECT_DIR>/dist/ will be removed.
* Use cleanOnceBeforeBuildPatterns to override this behavior.
*
* During rebuilds, all webpack assets that are not used anymore
* will be removed automatically.
*
* See `Options and Defaults` for for information
*/
new CleanWebpackPlugin(),
],
};
module.exports = webpackConfig;ref: https://github.com/johnagan/clean-webpack-plugin
问题
跨域问题
chrome 安装 Moesif Orign & CORS Changer 插件,并开启
?raw 什么作用
- 将改变任何类型文件的字符串导入(参考)
import richtextRedo from '../assets/richtext_redo.svg?raw';最近更新
最新评论