当前位置:网站首页>Build ES6 development environment and compile in real time
Build ES6 development environment and compile in real time
2022-04-22 07:18:00 【Xiaofan Hall】
establish dist、public/index.html、src/index.js Contents and documents
Project directory

package.json
{
"name": "es6-env",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --mode development --open",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"babel-loader": "^8.1.0",
"css-loader": "^3.6.0",
"html-webpack-plugin": "^4.3.0",
"style-loader": "^1.2.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
}
webpack.config.js
const path = require('path')
const HtmlWebPackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
},
devServer: {
contentBase: './dist',
host: 'localhost',
port: 3000
},
plugins: [
new HtmlWebPackPlugin({
template: 'public/index.html',
filename: 'index.html',
inject: true,
}),
],
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.js?$/, // jsx/js Regularization of files
exclude: /node_modules/, // exclude node_modules Folder
use: {
// loader yes babel
loader: 'babel-loader',
options: {
// babel Escape configuration options
babelrc: false,
presets: [
[require.resolve('@babel/preset-env'), {
modules: false }],
],
cacheDirectory: true,
},
},
},
],
},
}
版权声明
本文为[Xiaofan Hall]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220610180081.html
边栏推荐
- 微信第三方网页授权
- Quotient principle of modular division
- RSS pit entry Guide
- 分页
- Methods and skills of fast reading papers
- Jenkins部署pm2
- Raspberry Pi 4b
- 浙大版《C语言程序设计(第3版)》题目集 练习7-4 找出不是两个数组共有的元素
- . net learning notes - about Net core (3) [reading configuration files, general parsing JSON files, reading static files]
- IDEA debug调试教程
猜你喜欢

14行代码完成任意选择图片爬取

提示用户输入其名字 用户作出响应后 将其名字写 入到文件guest.txt 中 程序判断当不等于n的时候,就执行 创建文件data.txt,文件共10万行,每行存放一个1~100之间的随机一个整数

假设成年人的体重和身高存在此种关系: 身高(厘米)-100=标准体重(千克) 如果一个人的体重与其标准体重的差值在正负5%之间,显示“体重正常”,其他则显示“体重超标”。编写程序,能处理用户输入的

Relationship between Nacos namespace grouping and dataid

.NET学习笔记(一)----泛型的引入、优势、设计思想、原理、应用

paging

Comparison and improvement of Nacos service registration center

Installer et modifier les chemins d'installation des plug - ins utools et vscode

Goodbye, postman. One thing to say: apifox is yyds

Nacos服务提供者注册
随机推荐
[bug notes] the sessionstorage data cannot be obtained after the page is refreshed
ParseException Unparseable date 时间转换异常
【SVN】Subversion安装使用笔记
安装和修改uTools及vscode插件安装路径
PowerJob 工作流
Sad process from Fab factory to IC Verification
C#日常开发随手记----解决一个集合引用另一个集合导致一起改变
. net learning notes - about Net core (3) [reading configuration files, general parsing JSON files, reading static files]
short circuit
Nacos持久化切换配置
C#日常开发随手记------获取华为云桶中ZIP内的所有文件(包含System.NotSupportedException:“此流不支持查找操作“解决方法)
.NET学习笔记(一)----泛型的引入、优势、设计思想、原理、应用
再见了Postman,有一说一:Apifox才是YYDS
ASP.NET日常开发随手记------用文本文档记录日志
leetcode 打卡
Methods and skills of fast reading papers
SQLSERVER存储过程开发笔记----零碎问题以及关于操作文件的操作
用大写的字段接受最终首字母却变小写
【Bug小记】keepalive下mounted只执行一次
. net daily thoughts - compare two JSON files and get data with the same tag but different values