小编Ste*_*acy的帖子

Gulp使用@import观察并编译更少的文件

我正试图让我的头脑一直看着并编译一个无项目+ livereload.我有一个使用的style.less文件@import.当我运行gulp任务时,它似乎不理解导入.当我修改main less文件时,gulp编译文件并刷新浏览器,但如果我只修改导入,则忽略更改.

这是我的gulpfile.js

var gulp = require('gulp');
var less = require('gulp-less');
var watch = require('gulp-watch');
var prefix = require('gulp-autoprefixer');
var plumber = require('gulp-plumber');
var livereload = require('gulp-livereload');
var path = require('path');

gulp.task('default', function() {
    return gulp.src('./style.less')
        .pipe(watch())
        .pipe(plumber())
        .pipe(less({
          paths: ['./', './overrides/']
        }))
        .pipe(prefix("last 8 version", "> 1%", "ie 8", "ie 7"), {cascade:true})
        .pipe(gulp.dest('./'))
        .pipe(livereload());
});
Run Code Online (Sandbox Code Playgroud)

我尝试不指定主文件名,gulp.src('./*.less')但是所有较少的文件都是单独编译的.

谢谢

javascript livereload gulp gulp-less

19
推荐指数
1
解决办法
2万
查看次数

执行Byte数组作为新程序

我正在创建一个程序,看看我是否可以在C#中运行一个字节数组.

该程序应该获取一个字节数组"MyBinaryData"并加载+运行它作为一个新程序.将有一个文本框,您可以在其中输入字节以查看结果(这是一个实验;)).我试过这个:

 byte[] binaryData = System.IO.File.ReadAllBytes("MyBytes.txt");  // the bytes are in a .txt file for simple tests before becoming a textbox.
 Assembly LoadByte = Assembly.Load(binaryData);
        MethodInfo M = LoadByte.EntryPoint;

        if (M != null)
        {                object o = LoadByte.CreateInstance(M.Name);
            M.Invoke(o, new Object[] { null });  // this gives the error
        } 
        else {  
         ..... fail code here.... 
             } 
Run Code Online (Sandbox Code Playgroud)

问题是它给出了这个错误:"System.Reflection.TargetInvocationException:......必须在应用程序中创建第一个IWin32Window对象之前调用SetCompatibleTextRenderingDefault."

我的第二个测试是:

 Assembly assembly = Assembly.Load(binaryData);

 Type bytesExe = assembly.GetType(); // problem: the GetType(); needs to know what class to run.
 Object inst …
Run Code Online (Sandbox Code Playgroud)

c# bytearray

5
推荐指数
1
解决办法
4165
查看次数

为什么“如果不是无”返回 True?

我很难理解这个

我试过:

if not None:
    print('True')
Run Code Online (Sandbox Code Playgroud)

为什么它打印 True?不None应该是类型None吗?

python-3.x nonetype

2
推荐指数
1
解决办法
9223
查看次数

Gulp处理文件名

我如何使用文件名gulp.src,让我们说基于这些文件名在内存文件中创建,并将流管道传递给其他文件名?

假设我想获取所有*.styl文件并将找到的每个文件路径推送到内存文件前缀@import,然后将该流传输到stylus编译器.这样的事情:

gulp.src('./src/**/*.styl',{read:false})
.pipe(function(filename){
      return "@import '"+filename+"'"
 })
 .pipe(streamify())
 .pipe(stylus())
 .pipe( gulp.dest('./bin/combined.css'));
Run Code Online (Sandbox Code Playgroud)

我找不到任何好的包装,让你阅读和组合手写笔文件,所以我想也许我可以解决这个问题?

可能我最终会遇到范围,样式优先和破坏特异性规则的问题,但我需要将我的样式合并到一个文件中

javascript concatenation stylus gulp

1
推荐指数
1
解决办法
1363
查看次数