node.js - webpack-dev-server正常运行,webpack打包却出错,怎么办?
阿神
阿神 2017-04-17 15:06:43
0
2
552

一直在用webpack-dev-server开发,一切正常。结果在用webpack打包时却出错了。错误信息非常长,终端都显示不全。。。出错的路径都在node_modules中,错误信息基本是这两个:
Module not found: Error: Cannot resolve module 'fs' in xxxxxxx
和 You may need an appropriate loader to handle this file type.(载入json文件时)。
但是,运行webpack-dev-server却能够正常运行,并且和webpack打包时用的是同一个config文件。
不明白为什么直接用webpack打包会出错?请问问题出在哪呢?

阿神
阿神

闭关修行中......

reply all(2)
刘奇

Solved, it turns out that I accidentally put --progress between --config and webpack.prod.config.js. I just adjusted it. . . What a stupid mistake. . .

洪涛

It should be that the dependent package is missing. Try reinstalling the package. If you see something missing, install it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template