# case001 **Repository Path**: usaliva/case001 ## Basic Information - **Project Name**: case001 - **Description**: 使用 Webpack 实现简单的 Vue 项目打包任务 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-04 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 作业讲解 ## 安装模块 根据使用安装模块 - webpack - webpack-cli - webpack-dev-server - webpack-merge - webpack插件 - copy-webpack-plugin - clean-webpack-plugin - html-webpack-plugin - webpack加载器 - less-loader css-loader style-loader - url-loader file-loader - eslint - eslint - eslint-loader - eslint-plugin-vue 配置中使用的扩展 - babel-eslint 配置中使用的解析器 - babel - @vue/cli-plugin-babel 配置中使用的preset - 该集合中集成了@babel/core和babel-loader,项目中不用单独安装 - 框架 - vue 需安装到 dependencies - vue-loader 需配合 vue-template-compiler 使用 ## vue-loader vue-loader加载器可以解析处理vue单文件组件(SFC)。 它可以将vue组件解析的每个部分使用对应的loader,例如sytle标签使用sass,template标签使用pub。 具体过程: 1. 通过编译器,将vue中template、script、style标签中的内容提取,转化为导入导出的方式,用type参数区分使用的loader ```js // source.vue会被处理为: // import the