Coder Social home page Coder Social logo

webpack4.x_demo's Introduction

2019年 03-28日更新

  • 增加 npm run c page 命令,page代表页面的命名,执行后会在/src/pages/目录下自动创建page文件夹,并且在page文件夹里创建index.html,index.js ,index.scss
  • 增加动态添加入口,自动化配置页面

2019年 03-24日更新

更新如下

  • 所有插件升级到当前最高版本(2019-03-24)
  • 升级babel到目前最高版本后 babel7 后来的版本舍弃了以前的 babel-- 的命名方式,改成了 @babel/- 修改依赖和 .babelrc 文件后就能正常启动项目了,文档。 参考 https://segmentfault.com/a/1190000016458913, https://www.jianshu.com/p/e21d19875fbb
  • 删除extract-text-webpack-plugin,改用mini-css-extract-plugin 文档
  • 增加 npm run build --report 打包后文件大小分析命令

更新后报错

clean-webpack-plugin only accepts an options object

原因是clean-webpack-plugin插件更新版本后,new cleanWebpackPlugin(),里只能传一个对象参数了,配置地址https://github.com/johnagan/clean-webpack-plugin#options-and-defaults-optional

以下是原文

webpack4 demo


webpack4 多入口,多页面项目构建案例。

npm install

npm install //或
cnpm install

run

npm run dev //开发环境
npm run build //生产环境打包

文章介绍

License

Copyright (c) 2018-present, ypzhou

webpack4.x_demo's People

Contributors

zhouyupeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

webpack4.x_demo's Issues

下载下来 依赖都装不了

我的是mac
兄弟 你这个拉下来之后依赖装不了。把package-lock.json删掉,依赖能装了。但是不能打包就报错
image

端口问题

Error: listen EADDRINUSE 127.0.0.1:8888
at Server.setupListenHandle [as _listen2] (net.js:1336:14)
at listenInCluster (net.js:1384:12)
at doListen (net.js:1510:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at emitErrorNT (net.js:1363:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

问题场景: cnpm run build 的时候,出现此问题,没有找到方法

热更新

无法热更新,或者请问dev模式应该访问哪个链接才能热更新?谢谢

how to do?

Couldn't find preset "@babel/preset-env" relative to directory "E:\work\webpack-learn\node_modules\css-loader"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.