如何在Laravel 5.4中包含Bootstrap字形?
Chrome 中的网络工具向以下断开的链接显示 404 错误:http://localhost/fonts/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affebhttp://localhost/fonts/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158http://localhost/fonts/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512
路径应该是 http://localhost/myapp/public/font/glyphicons-halflings-regular...
我应该修复这些链接以便拥有引导字形吗? 如果是,如何以及在哪里?
关于这个问题的帖子谈到了以前版本的Laravel使用gulpfile.js它不会在laravel 5.4项目中退出。
@Warrio,是的,你是对的,Laravel 5.4不使用gulp,而不是gulp,它使用webpack mix来加载所有依赖项。
我有同样的问题,并通过更新包.json解决了
{
"private": true,
"scripts": {
"dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.15.3",
"bootstrap-sass": "^3.3.7",
"jquery": "^3.1.1",
"laravel-mix": "^0.8.1",
"lodash": "^4.17.4",
"vue": "^2.1.10"
}
}
更新您的package.json文件后,运行"npm install",它将解决您的问题。