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

html-static-before-plugin

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-static-before-plugin

---

1.0.11
latest
npm
Version published
Maintainers
1
Created
Source

html-static-before-plugin

Used

在html模板中添加额外的 *.js or *.css 文件,

初始化 redux store state

关键字 <!--<html-static-before-plugin>--> 被替换的位置

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!--<html-static-before-plugin>--> 
</head>
<body>
<div id="app"></div>
</body>
</html>
    new HtmlStaticBeforePlugin(options),

options

{
    assets: [
      'http://172.16.66.181:7998/react/v1/??react.production.min.js,react-dom.production.min.js,react-router-dom.min.js',
    ],
    initialState: {
      webSocket: 'ws://172.16.66.181'
    }
}

构建结果

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="http://172.16.66.181:7998/react/v1/??react.production.min.js,react-dom.production.min.js,react-router-dom.min.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>

FAQs

Package last updated on 30 Sep 2019

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