diff --git a/packages/namespace/lib/namespace-helper-ast.js b/packages/namespace/lib/namespace-helper-ast.js index fe1bb12..3d8ada5 100644 --- a/packages/namespace/lib/namespace-helper-ast.js +++ b/packages/namespace/lib/namespace-helper-ast.js @@ -26,7 +26,7 @@ function addArguments(builders) { } function addNamespaceArguments(node, moduleName, builders) { - if (node.path.original !== 'style-namespace') return; + if (Object.prototype.hasOwnProperty.call(node.path, 'value') || node.path.original !== 'style-namespace') return; const allArguments = getArguments(moduleName); const neededArguments = allArguments.filter( diff --git a/packages/preprocessor/index.js b/packages/preprocessor/index.js index ac65dff..430ae57 100644 --- a/packages/preprocessor/index.js +++ b/packages/preprocessor/index.js @@ -27,7 +27,7 @@ module.exports = { const options = this._options(app); const preprocessors = Object.assign({}, options.preprocessors); - registry.add('css', new Preprocessor(preprocessors)); + registry.add('css', new Preprocessor(preprocessors, options.outputPaths)); }, name: require('./package').name, diff --git a/packages/preprocessor/lib/preprocessor.js b/packages/preprocessor/lib/preprocessor.js index df4d021..39af00c 100644 --- a/packages/preprocessor/lib/preprocessor.js +++ b/packages/preprocessor/lib/preprocessor.js @@ -7,8 +7,9 @@ const merge = require('broccoli-merge-trees'); const witeFile = require('broccoli-file-creator'); module.exports = class Preprocessors { - constructor(preprocessors) { + constructor(preprocessors, outputPaths) { this.preprocessors = preprocessors; + this.outputPaths = outputPaths; this.ext = this.extensions; } @@ -26,7 +27,8 @@ module.exports = class Preprocessors { toTree(node, inputPath, outputPath, options) { const styles = []; - for (const [project, outFile] of Object.entries(options.outputPaths)) { + // the `??` is for `ember-cli` 5 compatibility + for (const [project, outFile] of Object.entries(this.outputPaths ?? options.outputPaths)) { styles.push( this.preprocess({ node,