簡體   English   中英

Symfony Encore / Webpack從未完成

[英]Symfony Encore/Webpack never completes

每當我嘗試運行Encore時,它都不會完成並掛在...

$ /vagrant/app/node_modules/.bin/encore dev
Running webpack ...

根據Symfony文檔,我刪除了node_modules並重新安裝了無數次。 僅使用npm過嘗試,也僅使用yarn過嘗試。 任何建議將不勝感激。 我已經包含package.jsonwebpack.config.js ,如果還有其他需要解決的問題,請告訴我。

package.json

{
  "devDependencies": {
    "@symfony/webpack-encore": "^0.20.1",
    "node-sass": "^4.9.0",
    "sass-loader": "^7.0.3"
  }
}

webpack.config.js

var Encore = require('@symfony/webpack-encore');

Encore
    // the project directory where compiled assets will be stored
    .setOutputPath('public/build/')
    // the public path used by the web server to access the previous directory
    .setPublicPath('/app/build')
    .setManifestKeyPrefix('build')
    .cleanupOutputBeforeBuild()
    .enableSourceMaps(!Encore.isProduction())
    // uncomment if you use Sass/SCSS files
    .enableSassLoader()
    // uncomment to create hashed filenames (e.g. app.abc123.css)
    // .enableVersioning(Encore.isProduction())

    // uncomment to define the assets of the project
    // .addEntry('js/app', './assets/js/app.js')
    .addStyleEntry('css/style', './assets/sass/style.scss')
    // .addStyleEntry('css/print', './assets/sass/print.scss')


    // uncomment for legacy applications that require $/jQuery as a global variable
    // .autoProvidejQuery()
;

module.exports = Encore.getWebpackConfig();

我發現了問題。 我必須在我的sass加載程序選項中禁用resolveUrlLoader

.enableSassLoader(function(options) {}, {
    resolveUrlLoader: false
})

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM