Regular Expressions 101

Sp⁠onsors

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

/
\s*<script src="\/((\w+)[\w.\/]+)"><\/script>
/
g

Description
Created·2019-04-21 03:53
Type·Substitution
Flavor·PCRE (Legacy)

/**
 * WebPack plugin which replaces <script src="bundle.js"> to:
 *
 * <script>
 *   const bundleScript = document.createElement('script');
 *   bundleScript.type = 'text/javascript';
 *   bundleScript.async = true;
 *   bundleScript.src = 'bundle.js';
 *   document.body.appendChild(bundleScript);
 * </script>
 *
 * @package js-create-includes-webpack-plugin
 * @class   JSCreateIncludesWebpackPlugin
 * @author  Denis Efremov <efremov.a.denis@gmail.com>
 * @license MIT
 */
Submitted by Anonymous
Open Workspace