課程
/前端開發
/前端工具
/webpack深入與實戰
不知道哪里出錯;求幫助
2017-07-31
源自:webpack深入與實戰 2-1
正在回答
修改配置信息以后css文件并沒有編譯。總是提示bundle。js沒有找到資源。報錯:index.html:11 GET file:///E:/aawebpack/bundle.js net::ERR_FILE_NOT_FOUND
以下是我修改的配置文件,請問這到底是怎么回事?
var path=require("path");
module.exports={
entry:"./src/js/app.js",
output:{
?path:__dirname+"/dist",
?filename:"bundle.js"
},
module:{
? loaders:[
? ? {test:/\.css$/,loader:"style-loader!css-loader"}
? ]
}
module.exports = {
entry: './src/script/main.js',
output: {
path:__dirname+'/dist/js',
filename: 'bundle.js'
const path = require('path') //將相對路徑轉換為絕對路徑
entry: './src/script/main.js', // 入口文件
path: path.resolve(__dirname,'dist/js'), // 打包后文件路徑,當前文件夾,子文件夾
filename: 'bundle.js', // 文件名稱
qq_卓小生_0 提問者
把path值中的點去掉
或者寫成這樣:path:__dirname+'/dist/js'
舉報
webpack實戰教程,用真實項目帶你探索 webpack 強大的功能
2 回答報錯。。。missing webpack???
2 回答輸入webpack報錯
3 回答webpack hello.js hello.bundle.js 報錯
3 回答輸入webpack報錯
2 回答webpack命令報錯
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-09-23
修改配置信息以后css文件并沒有編譯。總是提示bundle。js沒有找到資源。報錯:index.html:11 GET file:///E:/aawebpack/bundle.js net::ERR_FILE_NOT_FOUND
以下是我修改的配置文件,請問這到底是怎么回事?
var path=require("path");
module.exports={
entry:"./src/js/app.js",
output:{
?path:__dirname+"/dist",
?filename:"bundle.js"
},
module:{
? loaders:[
? ? {test:/\.css$/,loader:"style-loader!css-loader"}
? ]
}
}
2017-08-08
module.exports = {
entry: './src/script/main.js',
output: {
path:__dirname+'/dist/js',
filename: 'bundle.js'
}
}
2017-08-08
const path = require('path') //將相對路徑轉換為絕對路徑
module.exports = {
entry: './src/script/main.js', // 入口文件
output: {
path: path.resolve(__dirname,'dist/js'), // 打包后文件路徑,當前文件夾,子文件夾
filename: 'bundle.js', // 文件名稱
}
}
2017-07-31
把path值中的點去掉
或者寫成這樣:path:__dirname+'/dist/js'