# sample-page

> npm init --yes tsc --init

Latest version **1.0.0** (published 2020-12-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install sample-page
pnpm add sample-page
yarn add sample-page
bun add sample-page
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-12-10 |
| First published | 2020-12-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | xuyuanyuan88 |

## Links

- npm: https://www.npmjs.com/package/sample-page
- npm.io page: https://npm.io/package/sample-page

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.6.12

## Recent versions

- 1.0.0 (latest) — 2020-12-10

## README

### 初始化
npm init --yes
tsc --init

### 安装loader plugin 以及必要的工具
这些都是我们开发环境要用的依赖，所以我们这里安装的时候使用的是 npm install module_name -D  即 npm install module_name --save-dev 写入devDependencies，devDependencies只是我们开发使用。  
还有一点就是为了避免不兼容出现的问题，我们这里指定了
npm i webpack@4 webpack-cli@3 webpack-dev-server -D
npm i html-webpack-plugin clean-webpack-plugin webpack-merge ts-loader typescript -D

### 编写Webpack的4个配置文件
webpack.base.config.js 是开发环境和生产打包环境公共的一些配置；
webpack.dev.config.js 是开发环境的配置，devtool 配置为 cheap-module-eval-source-map，不显示错误信息的列号，定位到源码，并且能够保证build\rebuild的速度。
webpack.pro.config.js 是生产环境配置

### 编写启动和打包命令
在 package.json 文件中，分别编写启动和打包命令。启动脚本采用的是 webpack-dev-server， 打包脚本采用的是 webpack。

### 程序启动
npm start

### 打包
npm run build

### 增加Vue
npm i vue@2     // 指定vue版本
npm i vue-loader vue-template-compiler css-loader style-loader -D   // 开发环境需要

npm i webpack-node-externals -D

---
_Source: https://npm.io/package/sample-page · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
