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

npm モジュールでとってきたものを import sass するとやっぱりエラー。 #51

Closed
torounit opened this issue Feb 8, 2016 · 12 comments
Milestone

Comments

@torounit
Copy link
Contributor

torounit commented Feb 8, 2016

init-normalize がエラー。
normalizeをimportするのでは無く、copy するような実装に変えた方がいいやもしれぬ。

@torounit
Copy link
Contributor Author

torounit commented Feb 8, 2016

sass版にはnormalize 同梱しないとか・・・?

@inc2734 inc2734 added this to the v2 milestone Feb 9, 2016
@inc2734
Copy link
Member

inc2734 commented Feb 9, 2016

$ git clone git@github.com:inc2734/basis.git
$ git checkout -b develop
$ git pull origin develop
$ npm install
$ gulp

とやると普通にビルドできたのですが、僕の再現手法が間違っているか、前の issue であったような npm のバージョンの問題ですか?

@torounit
Copy link
Contributor Author

torounit commented Feb 9, 2016

npm 経由でとってくると、normalizeをとってくるときにばぐるっぽいです

@inc2734
Copy link
Member

inc2734 commented Feb 9, 2016

node@4.2.1、npm@3.6.0 で
npm install "git://github.com/inc2734/basis.git#develop"
でインストールできましたが、コマンドあってますかね…?

あ、これでとってきたのを使おうと(コンパイルしようと)したらバグるってことですかね

@torounit
Copy link
Contributor Author

torounit commented Feb 9, 2016

説明が悪いですね。

npm install "git://github.com/inc2734/basis.git#develop"

でとってきた basis に対して、

@import "../node_modules/sass-basis/src/scss/basis"

等とした場合、その Sass を普通にコンパイルした場合、node_modules からとってきている、normalize.scss が見つからん!というエラーを吐きます。

ユーザー側で、普通に gulp 等で、sass をコンパイルすると、sass-module-importer 等をインストールして設定してもらえれば解決するんですが、それはどうなのよ・・・・。というはなしです。

@inc2734
Copy link
Member

inc2734 commented Feb 9, 2016

あーなるほど理解しました。sass-module-importer がないと @import "inuit-normalize"; では勝手に node_modules の中から normalize をインポートできないわけですね。だからといって相対パスに書き直すと、2系と3系でパスが変わるから NG と。npm install したときに自動ビルド走るので、その中で npm 経由の normalize をコピーするようにすれば行けそうな気がしますが、すごくめんどくさそうなので最初から含めたほうがよくね?ということですね…。

@inc2734
Copy link
Member

inc2734 commented Feb 9, 2016

a43f8eb で僕の環境ではビルドできましたが、@torounit さんの環境でもビルドできますか?

@torounit
Copy link
Contributor Author

torounit commented Feb 9, 2016

git clone してきた場合、問題なかったです。

package.jsonに書いて実行した場合、npm install 時
node 5.5, npm 3.7 ではビルドできました。
ですが、 node 4.2.3 npm 2.14.7 だとエラーこきます。(たいした情報は無い) その後、もう一度 npm install するとビルドできます。。。

@inc2734
Copy link
Member

inc2734 commented Feb 10, 2016

おぉ、今度は2系でダメですか…。もう一度やるとビルドできるのであればもうこれでマージしちゃおうかな。。

@torounit
Copy link
Contributor Author

それ怒られる奴!

@inc2734
Copy link
Member

inc2734 commented Feb 10, 2016

(TT) 良い方法だと思ったんですけどね…。 安全なのは同梱ですかねー。Foundation や Bootstrap も同梱してるようですし。

@torounit
Copy link
Contributor Author

いや、これは!とは思ったんですがね。まぁ、バージョンが上がれば消滅する問題っぽいので、それまでは同梱してもいいのかなーとは。やり方自体は散々やったのでいつでも復活させらさますしw

inc2734 added a commit that referenced this issue Feb 13, 2016
@inc2734 inc2734 closed this as completed Feb 14, 2016
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