From 96b07b359e5cd5c3327260f0775a7720b50f6305 Mon Sep 17 00:00:00 2001 From: chenxsan Date: Wed, 9 Sep 2020 18:06:25 +0800 Subject: [PATCH] set code block language to typescript --- src/content/api/module-methods.md | 8 ++------ src/content/plugins/context-replacement-plugin.md | 13 ++++--------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/content/api/module-methods.md b/src/content/api/module-methods.md index 0adc937901aa..d6673d6d2484 100644 --- a/src/content/api/module-methods.md +++ b/src/content/api/module-methods.md @@ -166,9 +166,7 @@ The goal of CommonJS is to specify an ecosystem for JavaScript outside the brows ### `require` - - -``` javascript +```typescript require(dependency: String); ``` @@ -184,9 +182,7 @@ W> Using it asynchronously may not have the expected effect. ### `require.resolve` - - -``` javascript +```typescript require.resolve(dependency: String); ``` diff --git a/src/content/plugins/context-replacement-plugin.md b/src/content/plugins/context-replacement-plugin.md index fc986b4f3e0b..c2e8e81484df 100644 --- a/src/content/plugins/context-replacement-plugin.md +++ b/src/content/plugins/context-replacement-plugin.md @@ -4,6 +4,7 @@ contributors: - simon04 - byzyk - masives + - chenxsan related: - title: Issue 2783 - ContextReplacementPlugin Description url: https://github.com/webpack/webpack/issues/2783#issuecomment-234137265 @@ -18,9 +19,7 @@ The `ContextReplacementPlugin` allows you to override the inferred information. ## Usage - - -```javascript +```typescript new webpack.ContextReplacementPlugin( resourceRegExp: RegExp, newContentResource?: string, @@ -45,9 +44,7 @@ The `moment/locale` context is restricted to files matching `/de|fr|hu/`. Thus o ## Content Callback - - -```javascript +```typescript new webpack.ContextReplacementPlugin( resourceRegExp: RegExp, newContentCallback: (data) => void @@ -74,9 +71,7 @@ new webpack.ContextReplacementPlugin(/^\.\/locale$/, (context) => { The `newContentResource` and `newContentCreateContextMap` parameters are also available: - - -```javascript +```typescript new webpack.ContextReplacementPlugin( resourceRegExp: RegExp, newContentResource: string,