vue-loader加載不上怎么解決?很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
10年積累的成都做網(wǎng)站、成都網(wǎng)站制作經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有堯都免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。vue-loader 是要依賴 vue 的,所以先下載 vue
npm i vue -S
cnpm i vue-loader vue-template-compiler -D
webpack.config.js 中配置相關(guān)信息 注意:這里配置好了
再給大家看一下 我的 package.json 文件
注意:
css-loader style-loader 等等 我都已經(jīng)下載配置完成
{ "name": "webpack-study", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "webpack-dev-server --open --port 3000 --contentBase src --hot" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.26.3", "babel-loader": "^7.1.5", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.7.0", "babel-preset-stage-0": "^6.24.1", "css-loader": "^1.0.0", "file-loader": "^2.0.0", "html-webpack-plugin": "^3.2.0", "less": "^3.8.1", "less-loader": "^4.1.0", "node-sass": "^4.9.3", "sass-loader": "^7.1.0", "style-loader": "^0.22.1", "url-loader": "^1.1.1", "vue-loader": "^15.4.1", "vue-template-compiler": "^2.5.17", "webpack": "^4.17.1", "webpack-dev-server": "^3.1.5" }, "dependencies": { "vue": "^2.5.17", "webpack-cli": "^3.1.0" } }