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

Arguments to path.join must be strings Use #94

Open
jaryway opened this issue Feb 10, 2015 · 0 comments
Open

Arguments to path.join must be strings Use #94

jaryway opened this issue Feb 10, 2015 · 0 comments

Comments

@jaryway
Copy link

jaryway commented Feb 10, 2015

遇到一个很奇怪的问题

//这样写build正常
var template = require("tpl/"+"memberList");
//换成这样子,就报错误:Warning: Arguments to path.join must be strings Use --force to continue.
var template = require("tpl/memberList");
//似乎跟目录有关,我换成这样子也ok,但是我一旦把文件夹名称也改成tmpl也同样报错,难道在模块中不能这样写?
var s = require("tmpl/memberView");


//以下是我的Gruntfile
module.exports = function (grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        //cmd transport之后用于合并
        transport: {
            options: { idleading: 'dist/' /*模块ID前缀*/, debug: false },
            homepage: {
                //options: { idleading: '' },
                files: [{
                    expand: true,
                    //cwd: 'modules/',//需要处理的文件(input)所在的目录。
                    src: ['modules/*.js'],
                    dest: 'tran',
                    //ext: ".js",
                }],
            }
        }
    });
    function getZeptoModules() {
        var zepto_modules = [];
        var modules = [];
        //grunt.log.write(grunt.file.readJSON('package.json').zepto_modules.length)
        zepto_modules = grunt.file.readJSON('package.json').zepto_modules;
        for (var i = 0; i < zepto_modules.length; i++) {
            modules[i] = "zepto/" + zepto_modules[i] + ".js";
        }

        return modules;
    }
    //grunt.file.expand(['*' ])
    // 从node_modules目录加载模块文件
    grunt.loadNpmTasks('grunt-cmd-transport');


    // 每行registerTask定义一个任务
    grunt.registerTask('default', [ 'transport']);
    grunt.registerTask('check', ['jshint']);
};
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

1 participant