我正在使用Sublime Text 3并想使用LiveReload.我已安装Chrome浏览器插件.Node.js也已安装.
对于Sublime Text 3 Live Reload,必须安装此插件:https: //github.com/dz0ny/LiveReload-sublimetext2
如何在Windows 7上安装它?它只是说了一些关于Linux和OSX用户的内容.
我使用node-sass将我的所有Sass文件编译为master.css.这很好但现在我想添加前缀.我想只使用npm,没有Gulp或Grunt.
这是我的package.json文件:
{
"name": "xxxxxx.com",
"version": "1.0.0",
"description": "",
"watches": {
"sass": "src/scss/**"
},
"scripts": {
"sass": "node-sass src/scss/master.scss -o dist/css/ --style compressed",
"prefix": "postcss --use autoprefixer dist/css/master.css -d dist/css/master.css",
"dev": "rerun-script"
},
"author": "Jan",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^6.3.1",
"browserify": "^13.0.0",
"clean-css": "^3.4.9",
"node-sass": "^3.4.2",
"postcss-cli": "^2.5.0",
"rerun-script": "^0.6.0",
"uglifyjs": "^2.4.10"
}
}
Run Code Online (Sandbox Code Playgroud)
我不能让它运行.我使用autoprefixer和postcss-cli.这些模块已在本地安装在项目目录中.我认为我的"剧本"部分是错误的.那看起来怎么样?
我有一个master.scss,其中包含很多来自其他.scss文件的导入.如果我更改*.scss文件,则会自动生成master.css.
我只使用NPM,没有Gulp或Grunt!这应该保持不变.
我当前的构建脚本:
"scripts": {
"watch-sass": "sass --watch src/scss/master.scss:dist/css/master.css"
}
Run Code Online (Sandbox Code Playgroud)
这很好,但需要很长时间才能编译!
现在我正在尝试使用node-sass.它应该编译得非常快.不幸的是,我完全不了解它...
通过安装node-sassnpm install node-sass
我在哪里使用以下(来自文档)?
var sass = require('node-sass');
sass.render({
file: scss_filename,
[, options..]
}, function(err, result) { /*...*/ });
// OR
var result = sass.renderSync({
data: scss_content
[, options..]
});
Run Code Online (Sandbox Code Playgroud)
这不是package.json,对吧?
这是一个教程,我读过的内容: 使用NPM作为任务运行器
脚本很好.我怎么用呢?
"scripts": {
"sass": "node-sass sass/ -o build/css/"
}
Run Code Online (Sandbox Code Playgroud)
这将编译所有sass文件(不以下划线开头)到build/css /目录.
我希望对你有所帮助!
我无法安装分叉的 git 存储库。我想安装版本#0.31.0。
yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
C:\Users\qjan8\Websites\XXXXXX>yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
yarn add v1.7.0
[1/4] Resolving packages...
error Can't add undefined: invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Run Code Online (Sandbox Code Playgroud)
这必须是 的名称吗package.json?
node-sass ×2
node.js ×2
npm ×2
autoprefixer ×1
compilation ×1
css ×1
livereload ×1
sass ×1
sublimetext3 ×1
yarnpkg ×1