diff --git a/.gitignore b/.gitignore index 92cd867..3716209 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /samples/css.json /samples/output/ +/package-lock.json diff --git a/.travis.yml b/.travis.yml index ed4c1ca..4337be7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: node_js node_js: - 6 - 8 +- 9 before_install: - sudo apt-get -qq update diff --git a/lib/build-config.js b/lib/build-config.js index 97af3b9..8c60bf9 100644 --- a/lib/build-config.js +++ b/lib/build-config.js @@ -21,7 +21,17 @@ function translateBundlerConfigs(bundleConfigs, options) { return bundleConfigs.map(bundleConfig => { let inputFileName = path.resolve(configDir, bundleConfig.entryPoint); let outputStyle = compact ? "compressed" : "nested"; - let includePaths = [ path.resolve(configDir, "node_modules") ]; + // Use the node dependency resolution algorithm to figure out the + // includePaths – only available in Node 8.9 and up + let includePaths; + if(require.resolve.paths) { + includePaths = require.resolve.paths("something"); + } else { + includePaths = [ path.resolve(configDir, "node_modules") ]; + console.warn("You are using Node.js < 8.9. We can " + + "therefore only offer a fallback implementation for importing " + + "Sass files from npm packages"); + } let target = bundleConfig.target; let outputFilename = path.resolve(configDir, target); diff --git a/package.json b/package.json index 0b217e7..f9bc58c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "faucet-pipeline-sass", - "version": "0.7.1", + "version": "0.8.0", "description": "Sass Asset Pipeline", "main": "lib/index.js", "scripts": {