1.安装cnpm(https://npm.taobao.org/)
npm install -g cnpm --registry=https://registry.npm.taobao.org

2.在项目文件夹下安装node-sass
cnpm install --save-dev node-sass

说明:--save-dev自动将node-sass加入到项目文件夹下的package.json中

vue-cli 中的配置

第一步,

npm install node-sass --save-dev
npm install sass-loader --save-dev

第二部,打开webpack.base.config.js在loaders里面加上

    {
      test: /\.scss$/,
      loaders: ["style", "css", "sass"]
    }
    

第三部,在需要用到scss的地方写上

<style lang="scss" scoped>

</style>

via http://www.jianshu.com/p/0ccf4587122d

https://segmentfault.com/q/1010000007360125?_ea=1320927

GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐