eruda 的 webpack 插件,帮助调试移动端网页

栏目: 编程语言 · 发布时间: 6年前

内容简介:在浏览器中打开

English | 中文

eruda-webpack-plugin

eruda 的 webpack 插件

使用

npm i --save-dev eruda-webpack-plugin
// webpack.config.js
const ErudaWebapckPlugin = reuire('eruda-webpack-plugin')
const HtmlWebpackPlutin = require('html-webpack-plugin')

const config = {
  devServer: {
        contentBase: path.join(__dirname, 'dist'),
        port: 10000
  },
  mode: "development",
  plugins: [
    new HtmlWebpackPlutin({
      template: path.resolve(__dirname, 'index.html')
    }),
    new ErudaWebapckPlugin()
  ]
}

在浏览器中打开 http://localhost:1000 就可以调试你的移动端网页了

eruda 的 webpack 插件,帮助调试移动端网页

使用 eruda 的插件

new ErudaWebapckPlugin({
  plugins: ['fps', 'timing']
})

Options

force

eruda-webpack-plugin 默认只会在 development mode 生效, 如果你在其他 mode 中也想使用,可以设置 forcetrue

new ErudaWebpackPlugin({
  force: true
})

tool

选择你想要使用的 eruda 的功能,默认会全部加载。

new ErudaWebpackPlugin({
  tool: ['console', 'elements']
})

plugins

添加 eruda 的插件

new ErudaWebapckPlugin({
  plugins: ['fps', 'timing']
})

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Real-Time Rendering, Third Edition

Real-Time Rendering, Third Edition

Tomas Akenine-Moller、Eric Haines、Naty Hoffman / A K Peters/CRC Press / 2008-7-25 / USD 102.95

Thoroughly revised, this third edition focuses on modern techniques used to generate synthetic three-dimensional images in a fraction of a second. With the advent or programmable shaders, a wide varie......一起来看看 《Real-Time Rendering, Third Edition》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具