Laravel Mix不输出css文件

时间:2017-06-12 05:44:07

标签: php npm webpack laravel-5.4 laravel-mix

我已经在rappasof/laravel-5-boilerplate的主分支上克隆了代码,并且能够运行npm install,然后运行npm run dev。它会处理scss文件,因为它生成字体文件,但是没有生成css文件。

我正在继续:

  • Windows 10 x64
  • node.js 8.1.0
  • npm 5.0.3

这是npm run dev的输出:

PS D:\DevProjects\laravel-5-boilerplate.lar> npm run dev

> @ dev D:\DevProjects\laravel-5-boilerplate.lar
> npm run development


> @ development D:\DevProjects\laravel-5-boilerplate.lar
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting

 DONE  Compiled successfully in 3399ms                                                                                                                              02:02:31


                                                                                                    Asset       Size  Chunks                    Chunk Names
                       fonts/vendor/font-awesome/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9     166 kB          [emitted]
  fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1    20.1 kB          [emitted]
  fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512    45.4 kB          [emitted]
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158    23.4 kB          [emitted]
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb      18 kB          [emitted]
                       fonts/vendor/font-awesome/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713     166 kB          [emitted]
                       fonts/vendor/font-awesome/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde     444 kB          [emitted]  [big]
  fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760     109 kB          [emitted]
                     fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e    77.2 kB          [emitted]
                      fonts/vendor/font-awesome/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad      98 kB          [emitted]
                                                                                          /js/frontend.js    1.21 MB       0  [emitted]  [big]  /js/frontend
                                                                                           /js/backend.js     980 kB       1  [emitted]  [big]  /js/backend
                                                                                                   mix.js     619 kB       2  [emitted]  [big]  mix
                                                                                        mix-manifest.json  256 bytes          [emitted]

没有发出css文件!

我在apache之上使用laravel,所以我在资产网址上收到错误,因为它们绝对是root用户,因为http://localhost:8000/fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e而我需要的是http://localhost:8000/my-project/fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e

经过一番挖掘后,我发现如果我在mix.setResourceRoot('/my-project/');文件中添加webpack.mix.js,我可以正确生成资产链接,但我无法让Laravel Mix输出更正的内容css文件。

我该如何解决这个问题?

0 个答案:

没有答案