@released/check-lines
v1.1.0
Published
## 使用方式 1. npm i check-lines 2. package.json中启动命令添加 zline --PORT 7000 3. 客户端入口文件中导入client进行初始化 const {client} = require('check-lines') client() 4. webpack配置中配置loader插件 const {lineLoader} = require('check-lines') { test: /\.(ts|js)$/, u
Downloads
14
Readme
react项目网页中点击元素跳转对应组件
使用方式
npm i @released/check-lines
运行命令
npx zline --PORT 7000
指定端口启动服务客户端入口文件中导入client进行初始化
import client from '@released/check-lines'
// 在主入口文件中调用
client()
- 配置loader
webpack中配置loader插件
{
test: /\.(ts|js)$/,
use: '@released/check-lines',
exclude: /node_modules/
}
nextjs中的配置loader插件
- next.config.js 配置如下
const nextConfig = {
webpack: config => {
if(process.env.LOCAL){
config.module.rules.push(
{
test: /\.(ts|js)$/,
loader: '@released/check-lines',
exclude: /node_modules/
}
)
}
return config
},
env:{
LOCAL: !!process.env.LOCAL
},
}
- 跳转组件
- mac下 command/shift + 单击网页元素会自动跳转vscode代码中的对应组件
- windows下 win/shift + 单击网页元素会自动跳转vscode代码中的对应组件
注意vscode需要配置code命令
ctrl + shift + p 搜索code 选择code命令配置