In webpack, js introduces the problem of css file writing.

1. I use webpack4.x, to directly execute npm run dev in learning webpack to start webpack-dev-server-- when mode development, page f12 has only one index.js file in the following src folder in the source panel, and my css,less,sass folder cannot be displayed.
clipboard.png

index.js:
clipboard.png

2. Then I use the previous devtool:"source-map" sentence, and it is executed in the-- mode production situation, when the src folder only has an images folder and an index.js file, which is one more picture folder than the previous step. finally, I open the development mode and add this sentence, all the folders can be displayed, but the error will still be reported.

Why is this? Didn"t you say that you can develop mode debug as long as-- mode development? instead, there is only one index.js, and you have to add a "devtool:source-map"" to display all folders, and still report an error

.
Mar.25,2021

npm run build before npm run dev

Menu