Laravel 5.4 包括 bootstrap 个字形

Laravel 5.4 include bootstrap glyphicons

如何在 Laravel 5.4 中包含 Bootstrap 字形?

Chrome 中的网络工具显示以下损坏链接的 404 错误: http://localhost/fonts/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb http://localhost/fonts/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158 http://localhost/fonts/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512

路径应该是http://localhost/myapp/public/font/glyphicons-halflings-regular...

我应该修复这些链接以获得 bootstrap 字形吗?如果是,如何以及在哪里?

关于此问题的帖子讨论了 Laravel 的先前版本,该版本使用 gulpfile.js,它不会在 laravel 5.4 项目中退出。

@Warrio,是的,你是对的 Laravel 5.4 不使用 gulp,而不是 gulp 它使用 webpack mix 加载所有依赖项。

我有同样的问题,通过更新 package.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" 它将解决您的问题。