本文介绍了在西兰花样品应用中用西兰花罗盘取代西兰花的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用替换为,在。

我的应用程序结构如下:

My app structure looks like:

app
public
styles
  app.scss

Brocfile:

...
var compileSass = require('broccoli-compass')
...
var appNamespace = 'my-app-name';

function preprocess (tree) {
  tree = filterTemplates(tree, {
    extensions: ['hbs', 'handlebars'],
    compileFunction: 'Ember.Handlebars.compile'
  })

  return tree
}

var app = 'app'
app = pickFiles(app, {
  srcDir: '/',
  destDir: appNamespace // move under app namespace
})
app = preprocess(app)

var styles = 'styles'
styles = pickFiles(styles, {
  srcDir: '/',
  destDir: appNamespace
})
styles = preprocess(styles)

var tests = 'tests'
tests = pickFiles(tests, {
  srcDir: '/',
  destDir: appNamespace + '/tests'
})
tests = preprocess(tests)

var vendor = 'vendor'

var sourceTrees = [app, styles, vendor]
if (env !== 'production') {
  sourceTrees.push(tests)
}
sourceTrees = sourceTrees.concat(findBowerTrees())

var appAndDependencies = new mergeTrees(sourceTrees, { overwrite: true })

var appJs = compileES6(appAndDependencies, {
  loaderFile: 'loader.js',
  ignoredModules: [
    'ember/resolver'
  ],
  inputFiles: [
    appNamespace + '/**/*.js'
  ],
  legacyFilesToAppend: [
    'jquery.js',
    'handlebars.js',
    'ember.js',
    'ember-resolver.js'
  ],
  wrapInEval: false,
  outputFile: '/assets/app.js'
})

var appCss = compileSass(appAndDependencies, 'styles/app.scss')

var publicFiles = 'public'

module.exports = mergeTrees([appJs, appCss, publicFiles])

但是,当调用 broccoli serve 时,我收到以下错误:

However, I'm getting the following error when calling broccoli serve:

任何想法我在这里缺少什么?

Any idea what I'm missing here?

推荐答案

我将brocfile样式预处理更改为:

I changed the brocfile styles preprocess to:

var styles = 'styles'
styles = pickFiles(styles, {
  srcDir: '/',
  destDir: appNamespace + '/styles'
})
styles = preprocess(styles)

和compileSass调用:

and the compileSass call to:

var appCss = compileSass(appAndDependencies, appNamespace + '/styles/app.scss', {
    outputStyle: 'expanded',
    sassDir: appNamespace + '/styles',
    imagesDir: 'public/images/',
    cssDir: '/assets'
})

类似于这里的答案 -

Similar to the answer here - Compiling Compass in an Ember-CLI project

这篇关于在西兰花样品应用中用西兰花罗盘取代西兰花的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 10:24