Use html-webpack-plugin' to generate HTML page plugin in memory

Use html-webpack-plugin' to generate HTML page plugin in memory

When we package the webpackjs file, we introduce the global main.js in the index.html interface, as shown below:

Must import src ='budl.js'

When packaging, the unpacked files are divided into two files, one is a local disk file, and the other is a file in memory. This is very troublesome. In the face of this problem, we have a solution. Install this plug-in html-webpack-plugin

1. First, we enter npm i html-webpack-plugin to install the plug-in

2. Then configure the options in the webpack.config.js configuration file.

Installation Complete

webpack.config.js introduces html-webpack-plugin

Configure the generated interface file

3. After the plugin is installed, comment out the src="budle.js" of index and restart the project.

4. After restarting the project, the interface will automatically package a buld.js and import it in the index interface

Summarize

The above is the editor's introduction to using html-webpack-plugin' to generate HTML page plug-in in memory. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Detailed explanation of JSONObject usage

>>:  Deploy grafana+prometheus configuration using docker

Recommend

Use vertical-align to align input and img

Putting input and img on the same line, the img ta...

MySql COALESCE function usage code example

COALESCE is a function that refers to each parame...

Detailed explanation of how to use the calendar plugin implemented in Vue.js

The function to be implemented today is the follo...

XHTML Web Page Tutorial

<br />This article is mainly to let beginner...

JavaScript MouseEvent Case Study

MouseEvent When the mouse performs a certain oper...

Detailed steps for developing Java payment interface for Alipay

Table of contents first step Step 2 Step 3 Step 4...

How to implement mobile web page size adaptation

I finally finished the project at hand, and the m...

Linux series of commonly used operation and maintenance commands (summary)

Table of contents 1. System monitoring 2. File Op...

MySQL 8.0.12 decompression version installation tutorial

This article shares the installation tutorial of ...

HeidiSQL tool to export and import MySQL data

Sometimes, in order to facilitate the export and ...

Detailed explanation of MySQL foreign key constraints

Official documentation: https://dev.mysql.com/doc...

How to use binlog for data recovery in MySQL

Preface Recently, a data was operated incorrectly...

Solution to MySQL remote connection failure

I have encountered the problem that MySQL can con...