Comments (2)
This wouldn't be a bug. From the sounds of it, your watch
npm script runs webpack --watch
, i.e. upon every change to the dependency graph or other files in the bundle, re-run the bundling. When that happens, the clean: true
option under output
will clear your dist
directory before it outputs the resulting bundle into it.
This doesn't have anything to do with webpack-dev-server
. If you're using the dev server, you won't need to also run webpack --watch
. The dev server is standalone, then once you're ready to bundle and deploy, you bundle then deploy dist
.
If you want to use webpack's watch mode, then you won't use webpack-dev-server
.
What's happening is that because you haven't set a template for HtmlWebpackPlugin, it's going to delete everything in dist
(including any changes you made to dist/index.html
) before it bundles. What you're supposed to do as per the lessons and Restaurant Page project, is have an HTML file in src
, then set that as the template for HtmlWebpackPlugin. You don't do any development work in dist
at all - that's reserved purely for what Webpack outputs when you bundle things.
If you're still having problems with understanding any part of the Webpack lessons, feel most free to pop in our community Discord and write up a detailed and specific question, and I'm sure someone will be able to help you with whatever issue you're running into!
from curriculum.
from curriculum.
Related Issues (20)
- Introduction to Web Development: <Article Link is not working> HOT 1
- Feature Request : Making a change in the order between two parts of a lesson HOT 4
- Intermediate HTML & CSS: More Text Styles - Line height codepen improvement HOT 1
- Codespell: remove only warn setting HOT 1
- Linting: Prettier's installation guide link links to wrong site HOT 1
- Databases: Remove assignment HOT 3
- Deployment: PaaS default nodejs version HOT 3
- Installing Ruby: Update section of the instructions with rbenv init HOT 1
- Form Validation with JavaScript: wrong form validations link HOT 1
- OOP Principles: Change Knowledge Check to questions and amend link in #2 HOT 3
- Objects and Object Constructors: setPrototypeOf() not explained properly HOT 2
- Component Lifecycle Methods: <The first link in assignment has no english translation, its still in spanish> HOT 1
- Mini Message Board: Change "button" to "anchor" on item 11. HOT 4
- NodeJS: Typo in Introduction to Express Lesson. HOT 3
- DOM Manipulation and Events: <Short description of your suggestion>Error in the article linked to this chapter (Keyboard Events)
- DOM Manipulation and Events: <Short description of your suggestion> HOT 2
- Clean Code: About naming conventions HOT 1
- Introduction to Web Development: Change Udacity link to a Web Archive link (broken images) HOT 2
- Setting up Git: error in trying to install Git HOT 1
- Installations: The image of the tutorial is error HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curriculum.