# Webpack Workshop
> Using the Vanilla JavaScript TodoMVC Example
[![MIT License][license-badge]][LICENSE]
[![Donate][donate-badge]][donate]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]
<a href="https://app.codesponsor.io/link/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/es6-todomvc" rel="nofollow"><img src="https://app.codesponsor.io/embed/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/es6-todomvc.svg" style="width: 888px; height: 68px;" alt="Sponsor" /></a>
## Purpose
This was originally part of [an ES6 training](http://kcd.im/es6-intro-slides) by [Kent C. Dodds](https://twitter.com/kentcdodds)
Now I'm using it to teach people about [Webpack](http://webpack.github.io/):
- [Egghead.io lessons](http://kcd.im/egghead-webpack)
- [Frontend Masters](http://kcd.im/fem-webpack)
## Thanks
This codebase was originally taken from the TodoMVC project starting [here](https://github.com/tastejs/todomvc/tree/563d1e1b8cee5f6ec962ec43663cb66a72b69d76/examples/vanillajs). Big thanks to them!
## Latest Workshop
This repo has been used to teach in several different places (egghead, Frontend Masters, etc.). If you're coming here
to follow along with that, then I recommend you follow the project setup for that (see below). The most recent and
up-to-date version of the workshop is [the Frontend Masters workshop](http://kcd.im/fem-webpack). This is a linear
workshop and starts with the `FEM/00-original-project` branch. See
[the slides](https://slides.com/kentcdodds/webpack-deep-dive).
## Project Setup
This project assumes you have [NodeJS v6](http://nodejs.org/) or greater installed. You should
also have [npm v3](https://www.npmjs.com/) or greater installed as well (this comes packaged
with Node 6). You'll also need a recent version of [git](https://git-scm.com/) installed
as well.
You may have come to this project from different varying sources. There are a
different series of branches for each workshop/course I've done. To get started with
the project, start with this:
1. [Sign up](https://github.com/join) for a GitHub Account (if you don't already have one)
2. [Fork](https://help.github.com/articles/fork-a-repo/) this repo
3. [Clone](https://help.github.com/articles/cloning-a-repository/) your fork
4. In the directory you cloned the repository, run `git fetch --all`
If you need help with these steps, you might check out
[this free Egghead.io course](http://kcd.im/pull-request) which can help you get things going.
Finally, based on which version of the project you're looking for (workshop, egghead, or
Frontend Masters) you'll run one of the following commands in the cloned directory:
- **ES6 Workshop**: `npm run setup:workshop`
- **Egghead Course**: `npm run setup:egghead`
- **Frontend Masters Workshop**: `npm run setup:fem`
If you get any failures at this point something is wrong and needs to be fixed. Remember,
[Google](https://google.com) and [StackOverflow](https://stackoverflow.com) are your friends.
You might find it helpful to see a list of the available branches. Run: `git branch` for that.
## Notes
Because Webpack 2 is currently in beta, there are issues with `peerDependencies`, so you’ll have to use npm version 3 to be able to install the dependencies.
Running Webpack with `webpack -p` is not [showing the warnings](https://webpack.js.org/guides/migrating/#uglifyjsplugin-warnings) about the dead code elimination anymore. However, it is working as expected.
### Updates
The ecosystem moves fast. So this section of the README will be dedicated to tracking changes in the ecosystem so you
can follow the repo, but be aware of changes in the latest versions of the dependencies you'll be installing (or if
there are better dependencies to use now).
- All courses
- `babel-preset-es2015-webpack` is no longer necessary for leveraging tree shaking. You can now just use
`babel-preset-es2015` with a special configuration to indicate modules should not be transformed.
[More info](https://github.com/kentcdodds/es6-todomvc/issues/13)
- Egghead Course
- Using `istanbul` is no longer necessary for checking code coverage and can actually be accomplished using special
configuration in `karma.conf.js` with the `karma-coverage` plugin like
[this](https://github.com/kentcdodds/es6-todomvc/blob/f4f790ef7602bf9de4620841848d91f5213e647e/karma.conf.js#L22-L29).
### Contributing
Super nice that you're interested in contributing. Unfortunately things are pretty complex with how things are set up
with branches for each section of the workshop. So feel free to file pull requests to indicate what needs to be changed
but if I decide to implement a change in the workshop code, I'll probably just have to manually make the updates.
Thanks!
## Windows 10 Setup Instructions
1. Fork and clone this repository
2. Download Git Bash
3. Follow the instructions on this page to clone all branches at once in Git Bash: https://stackoverflow.com/questions/40310932/git-hub-clone-all-branches-at-once
4. In Git Bash: run `cd es6-todomvc`
5. Run `npm run setup:fem` (this will fail, but there is a workaround)
6. After that fails:
* In **Git Bash** run `git stash`
* run `git checkout FEM/00-original-project --force`
* Make sure http-server is installed globally: `npm i -g http-server`
* run `http-server --silent -c-1 -p 3084` (or whatever port number you want to use). If the port number you are trying to use is already in use, it will give you a nasty error that says something like: Error: listen EADDRINUSE 0.0.0.0:8081
* Open `http://localhost:3084/` or change the URL to indicate the port number you wish to use
* In your package.json file, add `-p 3084` to the end of your "start" script
* Add `open http://localhost:3084/ && ` to the beginning of your start script (make sure there is a space between `&&` and `http-server`
* now you can just run `npm start` and the app should load up at `http://localhost:3084`
## LICENSE
MIT
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[license]: https://github.com/kentcdodds/es6-todomvc/blob/master/LICENSE
[donate-badge]: https://img.shields.io/badge/%EF%BC%84-support-green.svg?style=flat-square
[donate]: http://kcd.im/donate
[github-star-badge]: https://img.shields.io/github/stars/kentcdodds/es6-todomvc.svg?style=social&label=Star
[github-star]: https://github.com/kentcdodds/es6-todomvc/stargazers
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20this%20fantastic%20webpack%20workshop!%20http://kcd.im/webpack-workshop-repo%20%F0%9F%98%8E
[twitter-badge]: https://img.shields.io/twitter/url/https/kcd.im/webpack-workshop-repo.svg?style=social
没有合适的资源?快使用搜索试试~ 我知道了~
es6-todomvc:vanillajs示例转换为es6
共25个文件
js:14个
css:1个
babelrc:1个
需积分: 9 1 下载量 129 浏览量
2021-05-25
20:27:51
上传
评论
收藏 21KB ZIP 举报
温馨提示
Webpack研讨会 使用Vanilla JavaScript TodoMVC示例 目的 这最初是由进行的一部分 现在,我正在用它来教人们关于: 谢谢 该代码库最初来自于TodoMVC项目,从开始。 非常感谢他们! 最新工作坊 此仓库已在多个不同的地方(egghead,Frontend Master等)进行教学。 如果您是来这里跟随的,那么我建议您遵循该项目的设置(请参见下文)。 该研讨会的最新版本是。 这是一个线性研讨会,从FEM/00-original-project分支开始。 见幻灯片。 项目设置 该项目假定您已安装NodeJS v6或更高版本。 您还应该安装npm v3或更高版本(这与Node 6一起包装)。 您还需要安装最新版本的git 。 您可能来自不同的来源来参加此项目。 我完成的每个讲习班/课程都有不同的分支机构。 要开始该项目,请从此开始: 注册一个GitHub帐户
资源详情
资源评论
资源推荐
收起资源包目录
es6-todomvc-main.zip (25个子文件)
es6-todomvc-main
.gitignore 68B
.babelrc 220B
.eslintrc 1007B
package.json 3KB
src
app.js 565B
controller.js 6KB
bootstrap.js 830B
helpers.js 2KB
store.js 4KB
view.js 5KB
todo.js 890B
controller.test.js 133B
index.html 2KB
app.css 313B
graph
render.js 920B
index.js 1KB
model.js 3KB
template.js 3KB
karma.conf.js 1KB
webpack.config.babel.js 2KB
LICENSE 1KB
.eslintignore 29B
readme.md 7KB
favicon.ico 1KB
.gitattributes 29B
共 25 条
- 1
杜佳加
- 粉丝: 47
- 资源: 4625
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0