惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
量子位
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
Y
Y Combinator Blog
L
LangChain Blog
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
U
Unit 42
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客

博客园 - 滴水冰寒

阿里云linux--常用命令 electron桌面应用 wepack打包时出错不压缩代码及使用es7(async await)新语法问题 npm install 时发生错误 create-react-app 后使用babel/polyfill webpack--打包scss webpack--打包和压缩css react--2.react-redux react--1.创建项目 百度智能语音引用1 vscode和gitee的使用 vue--1.环境搭建及创建项目 Python内置的服务器的使用 ionic3问题记录 ionic3自定义android原生插件 maven学习--1.项目结构及简单使用 maven学习--1.安装与配置 mybatis学习笔记1.零碎记录 mysql学习--1.事务
webpack3.x--react,jsx多页配置
滴水冰寒 · 2019-07-04 · via 博客园 - 滴水冰寒

1.安装包 es6语法解析,react与jsx解析的相关包

npm install babel-core babel-preset-env babel-preset-react --save-dev

2.安装react

npm install react --save-dev

3.webpack.config.js文件

{
                //转换es6语法
                test:/(\.jsx|\.js)$/,
                use:{
                    loader:"babel-loader",
                },
                exclude:/node_modules/ //排除转换目录
            }
    

4.根目录新建.babelrc文件

{
    "presets":["env","react"]
}