課程
/前端開發(fā)
/前端工具
/webpack深入與實(shí)戰(zhàn)
不知道哪里出錯(cuò);求幫助
2017-07-31
源自:webpack深入與實(shí)戰(zhàn) 2-1
正在回答
修改配置信息以后css文件并沒(méi)有編譯??偸翘崾綽undle。js沒(méi)有找到資源。報(bào)錯(cuò):index.html:11 GET file:///E:/aawebpack/bundle.js net::ERR_FILE_NOT_FOUND
以下是我修改的配置文件,請(qǐng)問(wèn)這到底是怎么回事?
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') //將相對(duì)路徑轉(zhuǎn)換為絕對(duì)路徑
entry: './src/script/main.js', // 入口文件
path: path.resolve(__dirname,'dist/js'), // 打包后文件路徑,當(dāng)前文件夾,子文件夾
filename: 'bundle.js', // 文件名稱
qq_卓小生_0 提問(wèn)者
把path值中的點(diǎn)去掉
或者寫成這樣:path:__dirname+'/dist/js'
舉報(bào)
webpack實(shí)戰(zhàn)教程,用真實(shí)項(xiàng)目帶你探索 webpack 強(qiáng)大的功能
2 回答報(bào)錯(cuò)。。。missing webpack???
2 回答 webpack-dev-server報(bào)錯(cuò)
3 回答webpack hello.js hello.bundle.js 報(bào)錯(cuò)
4 回答npm run webpack報(bào)錯(cuò)
2 回答npm run webpack報(bào)錯(cuò)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-09-23
修改配置信息以后css文件并沒(méi)有編譯??偸翘崾綽undle。js沒(méi)有找到資源。報(bào)錯(cuò):index.html:11 GET file:///E:/aawebpack/bundle.js net::ERR_FILE_NOT_FOUND
以下是我修改的配置文件,請(qǐng)問(wèn)這到底是怎么回事?
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') //將相對(duì)路徑轉(zhuǎn)換為絕對(duì)路徑
module.exports = {
entry: './src/script/main.js', // 入口文件
output: {
path: path.resolve(__dirname,'dist/js'), // 打包后文件路徑,當(dāng)前文件夾,子文件夾
filename: 'bundle.js', // 文件名稱
}
}
2017-07-31
把path值中的點(diǎn)去掉
或者寫成這樣:path:__dirname+'/dist/js'