2017-01-08 16 views
0

当我尝试使用最新的基础网站包, 我收到了一堆新的scss编译错误。 如果有人有一些线索,高度赞赏。重现为什么基础站点不能在6.3.x上用早午餐编译?

步骤:

版本

elixir 1.4.0 
phoenix 1.2.1 
node 6.4.2 

NPM包

"brunch": "~2.9.1", 
"css-brunch": "~2.6.1", 
"foundation-sites": "^6.3.0", 

编译错误

08 Jan 23:48:36 - info: compiling 
08 Jan 23:48:37 - error: Compiling of web/static/scss/application.scss failed. Error: It's not clear which file to import for '@import "../_vendor/normalize-scss/sass/normalize"'. 
     Candidates: 
     ../_vendor/normalize-scss/sass/normalize 
     ../_vendor/normalize-scss/sass/_normalize.scss 
     Please delete or rename all but one of these files. 
     on line 9 of node_modules/foundation-sites/scss/foundation.scss 
>> @import "../_vendor/normalize-scss/sass/normalize"; 
^

回答

0

使用此设置,我可以解决这个问题:) 希望它可以安全地搜寻一些其他小时。 这个家伙的荣誉:https://elixirforum.com/t/how-to-setup-foundation-sites-6-brunch-phoenix-app/2704/3

brunch-config需要一些调整,因为基础会导致一些本机lib-sass的奇怪行为。我发现,用ruby编译器,没有路径问题。

因此,当您明确从package.json和brunch-config中包含它时,即使它从基础中失败,也可以找到并导入normaliz-scss。

plugins: { 
    babel: { 
     presets: ['es2015', 'es2016', 'react'], 
     // Do not use ES6 compiler in vendor code 
     ignore: [/web\/static\/vendor/], 
    }, 
    sass: { 
     mode: 'native', 
     precision: 8, 
     options: { 
     includePaths: [ 
      'node_modules/normalize-scss/sass', 
      'node_modules/foundation-sites/scss', 
      'node_modules/motion-ui/src', 
     ], 
     }, 
    }, 
    postcss: { 
     processors: [ 
     require('autoprefixer')(['last 8 versions']), 
     require('csswring')() 
     ] 
    }, 
    },