ERROR in Entry module not found: Error: Can‘t resolve ‘./src/index.js‘ in‘xxx.js‘
程序员文章站
2022-06-22 20:10:59
webpack初学webpack打包的时候遇到这样的问题配置'use strict';const path = require('path');module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, mode: 'production'};关键是...
webpack
初学webpack打包的时候遇到这样的问题
配置
'use strict';
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
mode: 'production'
};
关键是执行文件的目录不对…
主要是因为webpack.config.js这个文件entry的相对路径问题,进入了node_modules/.bin 运行webpack相对路径找不到了,其实报错信息也说的很清楚。
Can’t resolve ‘./src/index.js’ in ‘E:webpack\webpack-demo\node_modules.bin’
意思就是从node_modules.bin 运行不了index.js,因为没有…
本文地址:https://blog.csdn.net/ZHgogogoha/article/details/107876107
上一篇: js开发环境配置
下一篇: FreeRTOS笔记(十二)资源管理
推荐阅读
-
Module not found: Error: Can't resolve 'XXX' in 'XXXX'
-
Module not found: Error: Can't resolve 'XXX' in 'XXXX'
-
Module not found:Error:Can`t resolve ‘less-loader‘ 解决办法
-
npm run dev 报错 ERROR in Entry module not found: Error: Can't resolve './src' in
-
ERROR in Entry module not found: Error: Can‘t resolve ‘./src/index.js‘ in‘xxx.js‘
-
ERROR in Entry module not found: Error: Can‘t resolve ‘./src/index.js‘ in‘xxx.js‘