Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@import 'normalize'; doesn't seem to work with less. #9

Open
kitsunde opened this issue Jul 31, 2016 · 2 comments
Open

@import 'normalize'; doesn't seem to work with less. #9

kitsunde opened this issue Jul 31, 2016 · 2 comments

Comments

@kitsunde
Copy link

kitsunde commented Jul 31, 2016

ember-cli: 2.7.0
node: 6.2.0
os: darwin x64

I have lessc 2.7.1. I created an example at https://github.com/kitsunde/ember-normalize-test but basically all I've done is install ember-normalize and ember-cli-less then added app.less:

@import 'normalize';

Stack trace from ember build:

FileError: 'normalize.less' wasn't found. Tried - /Users/kitsunde/Development/normalize-test/tmp/less_compiler-input_base_path-ujIthbJC.tmp/0/app/styles/normalize.less,/Users/kitsunde/Development/normalize-test/tmp/less_compiler-input_base_path-ujIthbJC.tmp/0/app/styles/normalize.less,/Users/kitsunde/Development/normalize-test/tmp/less_compiler-input_base_path-ujIthbJC.tmp/0/normalize.less,normalize.less in /Users/kitsunde/Development/normalize-test/tmp/less_compiler-input_base_path-ujIthbJC.tmp/0//app/styles/app.less on line 1, column 1:
1 @import 'normalize';
2

Build failed.
File: /Users/kitsunde/Development/normalize-test/tmp/less_compiler-input_base_path-ujIthbJC.tmp/0//app/styles/app.less (1)
The Broccoli Plugin: [LessCompiler] failed with:
undefined

The broccoli plugin was instantiated at:
    at LessCompiler.Plugin (/Users/kitsunde/Development/normalize-test/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
    at LessCompiler.CachingWriter [as constructor] (/Users/kitsunde/Development/normalize-test/node_modules/broccoli-caching-writer/index.js:18:10)
    at new LessCompiler (/Users/kitsunde/Development/normalize-test/node_modules/ember-cli-less/node_modules/broccoli-less-single/index.js:15:17)
    at /Users/kitsunde/Development/normalize-test/node_modules/ember-cli-less/index.js:28:12
    at Array.map (native)
    at LESSPlugin.toTree (/Users/kitsunde/Development/normalize-test/node_modules/ember-cli-less/index.js:24:34)
    at /Users/kitsunde/Development/normalize-test/node_modules/ember-cli-preprocess-registry/preprocessors.js:184:26
    at Array.forEach (native)
    at processPlugins (/Users/kitsunde/Development/normalize-test/node_modules/ember-cli-preprocess-registry/preprocessors.js:182:11)
    at module.exports.preprocessCss (/Users/kitsunde/Development/normalize-test/node_modules/ember-cli-preprocess-registry/preprocessors.js:152:10)

Plain app.css and @import 'normalize.css'; still works.

@kitsunde
Copy link
Author

As workaround make less inline normalize.css:

@import (inline) 'normalize.css';

I also tried some other variations:

@import 'normalize.css'
@import (css) 'normalize';
@import (css) 'normalize.css';

All of which raise exceptions.

@kitsunde kitsunde changed the title @import 'normalize'; doesn't seem to work. @import 'normalize'; doesn't seem to work with less. Jul 31, 2016
@noslouch
Copy link

👍 same issue with compass. Since this only provides the normalize.css package, SASS won't import it as a module. I ended up using normalize-scss and doing the following:

// ember-cli-build.js
var app = new EmberApp(defaults, {
  compassOptions: {
    importPath: ['bower_components/normalize-scss/sass']
    }
  });
// app/styles/app.scss
@import "normalize/import-now";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants