Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
local-mock-h5
Advanced tools
English | 简体中文
A h5 debug plugin for eruda and vConsole.
yarn add local-mock-h5
// #!if ENV === "development"
import eruda from 'eruda'
import { erudaLocalMock } from 'local-mock-h5'
eruda.init()
const localMockplugin = erudaLocalMock(eruda, {
state: '0',
proxy: 'http://localhost:8080',
})
eruda.add(localMockplugin)
// #!endif
// #!if ENV === "development"
import VConsole from 'vconsole'
import { vconsoleLocalMock } from 'local-mock-h5'
const vconsole = new VConsole()
const localMockplugin = vconsoleLocalMock(VConsole, {
state: '0',
proxy: 'http://localhost:8080',
})
vconsole.addPlugin(localMockplugin)
// #!endif
devServer
Since the entry file of 'devServer' is loaded in the domain name, you need to configure cross-origin and configure publicPath to load local static resources.
{
"devServer": {
"publicPath": "http://localhost:8080",
"port": 8080,
"headers": {
"Access-Control-Allow-Origin": "*"
}
}
}
publicPath
and proxy
change to http://{ip}:{port}
, such as: http://192.168.1.10:8080
Because the page resources of lcoalhost:8080 cannot be accessed on the mobile machine
FAQs
A h5 debug plugin for eruda and vConsole.
The npm package local-mock-h5 receives a total of 0 weekly downloads. As such, local-mock-h5 popularity was classified as not popular.
We found that local-mock-h5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.