我正在使用节点v6.10.3 .
config.json
{
“root”:{“src”:“ . / src”,“dest”:“ . / static”,“dist”:“ . / dist”},
“tasks”:{“browserSync”:{“port”:4500,“open”:false,“server”:{“baseDir”:“ . /”}},
"static": {
"src": "src",
"dest": "static"
},
"js": {
"src": "js",
"dest": "static/js",
"entries": {
"app": ["./app.js"]
},
"extensions": ["js", "json"],
"babel": {
"presets": ["es2015", "stage-1"],
"plugins": []
},
"extractSharedJs": false
},
"css": {
"src": "scss",
"dest": "css",
"autoprefixer": {
"browsers": ["> 0%"]
},
"sass": {
"indentedSyntax": true,
"includePaths": [
"./node_modules/normalize.css"
]
},
"extensions": ["sass", "scss", "css"]
},
"html": {
"src": "templates",
"dest": "./",
"dataFile": "data/global.json",
"htmlmin": {
"collapseWhitespace": true
},
"extensions": ["html", "json", "tpl"],
"excludeFolders": ["layouts", "partials", "macros", "data", "components"]
},
"images": {
"src": "img",
"dest": "img",
"extensions": ["jpg", "png", "svg", "gif"]
},
"fonts": {
"src": "fonts",
"dest": "fonts",
"extensions": ["woff2", "woff", "eot", "ttf", "svg"]
},
"iconFont": {
"src": "svg-font",
"dest": "fonts",
"sassDest": "generated",
"extensions": ["woff2", "woff", "eot", "ttf", "svg"]
},
"svgsprites": {
"src": "svg",
"dest": ".",
"extensions": ["svg"]
},
"production" : {
"rev": true
},
"critical" : {
"src": "*.html",
"width": 1920,
"height": 1080
},
"favicon": {
"src": ".",
"name": "favicon.ico",
"dest": "."
}
}}
Error
./src/js/app.js中的错误模块构建失败:TypeError:Path必须是字符串 . 在Object.dirname(path.js:695:5)的C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \中的assertPath(path.js:7:11)收到undefined babel-core \ lib \ transformation \ file \ options \ option-manager.js:353:36 at C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel-core \ lib位于OptionManager.resolvePresets(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules)的Array.map(native)上的\ transformation \ _file \ options \ option-manager.js:375:22 OptionManager.mergePresets上的\ babel-core \ lib \ transformation \ file \ options \ option-manager.js:364:20)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules OptionManager.mergeOptions上的\ babel-core \ lib \ transformation \ file \ options \ option-manager.js:348:10)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:307:14)在C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \在C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel中的theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:349:14在OptionManager.resolvePresets(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes)的Array.map(native)中的-core \ lib \ transformation \ file \ options \ option-manager.js:369:24 OptionManager.mergePresets上的\ theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:364:20)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes OptionManager.mergeOptions上的\ theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:348:10)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes OptionManager.init上的\ theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:307:14)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes File.initOptions上的\ theme \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:465:10)(C:\ Users \ user \ D新文件中的ocuments \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel-core \ lib \ transformation \ file \ index.js:194:75)(C:\ Users \ user \ Documents \ Projekty \ Project Pipet.transform上的\ wp-content \ themes \ theme \ node_modules \ babel-core \ lib \ transformation \ file \ index.js:123:22)(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel-core \ lib \ transformation \ pipeline.js:45:16)在transpile上(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel -loader \ index.js:14:22)在Object.module.exports(C:\ Users \ user \ Documents \ Projekty \ Project \ wp-content \ themes \ theme \ node_modules \ babel-loader \ index.js:88) :12)@ multi app