npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ptbird/webpack3-react-development

v0.0.1

Published

webpack3 react development

Readme

这个开发开发环境只是为了能够快速的使用webpack来进行react的开发的入门使用,并不(完全)适用用生产环境的实际应用 因为没有考虑webpack的配置分离、生产环境的配置等很多东西,但是对于入门使用webpack进行react开发来说,没啥问题

一、问题

由于reactcreate-react-app本身不是使用webpack,而也不像vue给了一个非常好用的vue-cli

所以在使用webpack构建react的开发环境的时候遇到了很多问题。

尤其是网上很多都是webpack1.x / webpack2.x的指导,webpack3.x之后很多东西都发生了变化,而babel的更新也不建议使用preset-es201X这样的操作,建议直接使用babel-preset-env进行操作.

实际上我在自己配置的过程中遇到的最关键问题就是babeljsx语法的编译,一开始总是无法编译,后来发现自己的包安装有问题。(这算是自己给自己挖的坑吧)

二、使用的依赖

webpack的开发环境就是对webpack的各种loader的配置及其他配置而已,因此还是很好理解的,如果熟悉webpack的话最好不过。

建议去看一下webpack 3.x的文档啥的。

依赖列表:

"devDependencies": {
    "autoprefixer": "^7.1.5",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-env": "^1.6.0",
    "babel-preset-react": "^6.24.1",
    "css-loader": "^0.28.7",
    "extract-text-webpack-plugin": "^3.0.1",
    "file-loader": "^1.1.5",
    "html-webpack-plugin": "^2.30.1",
    "html-withimg-loader": "^0.1.16",
    "less": "^3.0.0-alpha.3",
    "less-loader": "^4.0.5",
    "node-sass": "^4.5.3",
    "postcss-loader": "^2.0.8",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "sass-loader": "^6.0.6",
    "style-loader": "^0.19.0",
    "uglifyjs-webpack-plugin": "^1.0.0-beta.3",
    "url-loader": "^0.6.2",
    "webpack": "^3.7.1",
    "webpack-dev-server": "^2.9.2"
  }

安装依赖:

安装完成后,可以直接通过npm install 安装依赖

npm install 

四、源码

地址:

  • https://github.com/postbird/webpack-react-development

五、最早发布于博文:

  • http://www.ptbird.cn/webpack3-react-development.html