You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@originjs/openharmony-webpack-plugin

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originjs/openharmony-webpack-plugin

0.7.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
5
Weekly downloads
 
Created
Source

openharmony-webpack-plugin

OpenHarmony Polyfill in Webpack.

Install

npm install @originjs/openharmony-webpack-plugin

at {YOUR_SDK_PATH}\Sdk\ets\3.0.0.0\build-tools\ets-loader

Usage

Add the following to your webpack.config.js: (at {YOUR_SDK_PATH}\Sdk\ets\3.0.0.0\build-tools\ets-loader)

const OpenHarmonyPolyfillPlugin = require('@originjs/openharmony-webpack-plugin');

module.exports = {
	// Other rules...
	plugins: [
		new OpenHarmonyPolyfillPlugin()
	]
}

API

Aliases

Globals

  • Buffer
  • process
  • crypto
  • fetch
  • XMLHttpRequest
  • TextDecoder
  • TextEncoder
  • URL
  • URLSearchParams

Modules

  • assert
  • buffer
  • crypto
  • domain
  • events
  • http
  • https
  • os
  • path
  • process
  • querystring
  • stream
  • url
  • util
  • fs

FAQ

TS2304: Cannot find name 'xx'

If you use these global API directly in ets, it may appear an TS2304 error. eg.

 ETS:ERROR File: examples\sdk7-demo\entry\src\main\ets\default\pages\textutil.ets:14:29
 TS2304: Cannot find name 'TextDecoder'.
 
 ETS:ERROR File: examples\sdk7-demo\entry\src\main\ets\default\pages\textutil.ets:31:29
 TS2304: Cannot find name 'TextEncoder'.
 
 ETS:ERROR File: examples\sdk7-demo\entry\src\main\ets\default\pages\textutil.ets:45:25
 TS2304: Cannot find name 'URL'.

Solutions: Add import statements:

import { TextDecoder } from 'openharmony-polyfill';
import { TextEncoder } from 'openharmony-polyfill';
import { URL } from 'openharmony-polyfill';

FAQs

Package last updated on 02 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.