課程
/前端開發
/前端工具
/Vue+Webpack打造todo應用
為什么出錯了
2018-04-26
源自:Vue+Webpack打造todo應用 2-1
正在回答
出現了同樣的錯誤,根據https://vue-loader.vuejs.org/guide/提示,修改為如下內容即可。
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
// this will apply to both plain .js files
// AND <script> blocks in vue files
test: /\.js$/,
loader: 'babel-loader'
// this will apply to both plain .css files
// AND <style> blocks in vue files
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
可能還會有錯誤,例如“ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in 'C:\Users\hbs\own\project\vuetest'”之類的,安裝相應包即可。
慕先生6553767 提問者
666老鐵給力,剛剛接觸,還是多謝大家幫助
OK了 ,非常感謝
求代碼貼圖 。同樣的問題
舉報
用前端最熱門框架Vue+最火打包工具Webpack打造todo應用
3 回答npm run build 出錯
1 回答npm run build 出錯
4 回答運行·npm run build 出錯·
2 回答npm run build報錯
2 回答npm run build 報錯
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-04-27
出現了同樣的錯誤,根據https://vue-loader.vuejs.org/guide/提示,修改為如下內容即可。
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
// this will apply to both plain .js files
// AND <script> blocks in vue files
{
test: /\.js$/,
loader: 'babel-loader'
},
// this will apply to both plain .css files
// AND <style> blocks in vue files
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}
]
},
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
]
}
可能還會有錯誤,例如“ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in 'C:\Users\hbs\own\project\vuetest'”之類的,安裝相應包即可。
2018-05-27
666老鐵給力,剛剛接觸,還是多謝大家幫助
2018-05-07
OK了 ,非常感謝
2018-05-07
求代碼貼圖 。同樣的問題