Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack vs GulpWebpack_Webpack_Gulp_Gulp Webpack - Fatal编程技术网

Webpack vs GulpWebpack

Webpack vs GulpWebpack,webpack,gulp,gulp-webpack,Webpack,Gulp,Gulp Webpack,我正试图从gulp任务webpack处理包含.js文件的目录。我正在使用GulpWebpack1.5.0。吞咽任务定义为: return gulp.src(joinPath(config.aliasify.dest, 'index.js')) .pipe(webpack( require('./_____webpack.config.js') )) .pipe(gulp.dest('dist/')); _____webpack.config.js

我正试图从gulp任务webpack处理包含.js文件的目录。我正在使用GulpWebpack1.5.0。吞咽任务定义为:

return gulp.src(joinPath(config.aliasify.dest, 'index.js'))
            .pipe(webpack( require('./_____webpack.config.js') ))
            .pipe(gulp.dest('dist/'));
_____webpack.config.js是:

var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');

module.exports = {
    stats: {
        // Configure the console output
        errorDetails: true,
        colors: true,
        modules: true,
        reasons: true
    },
    progress: true,
    entry: "./out/js/index.js",
    output: {
        filename: "bundle.js",
        path: __dirname + "/dist"
    }

}
它失败得很惨。JSON文件似乎有问题:

./~/aws sdk/API/cognito-idp-2016-04-18.paginators.json中出错 模块解析失败:/Users/omatrot/Projects/trash/reactxp/samples/hello world/node_modules/aws sdk/api/cognito-idp-2016-04-18.paginators.json意外令牌(2:14) 您可能需要适当的加载程序来处理此文件类型。 SyntaxError:意外标记(2:14)

在同一个目录下运行webpack时,使用明显相同的配置可以很好地工作

webpack.config.ts file is:

import * as webpack from 'webpack';

const config: webpack.Configuration = {
    entry: "./out/js/index.js",
    output: {
        filename: "bundle.js",
        path: __dirname + "/dist"
    },

};

export default config;
Web包--显示错误详细信息--进度--颜色

散列:0a378df14f58624d244f 版本:网页2.2.1 时间:3920毫秒 资产大小块块名称 bundle.js 3.07 MB 0[已发出][大]主 bundle.js.map 3.71 MB 0[emissed]main [8] ./~/reactxp/index.js 146字节{0}[编译] [112]。/out/js/ExercisesStore.js 3.29 kB{0}[编译] [120]./~/amazon cognito identity js/es/CognitoRefreshToken.js 1.4kb{0}[builded] [126]./~/amazon cognito identity js/es/index.js 1.58 kB{0}[builded] [217]./out/js/App3.js 14.4kb{0}[builded] [278]./~/jwt decode/lib/index.js 680字节{0}[builded] [490]。/out/js/AlertAndPromptWeb.js 3.4kb{0}[编译] [494]。/out/js/editExecuteAttributePropertiesPanel.js 10.4KB{0}[Build] [495]。/out/js/editExecuteAttributesValuesPanel.js 9.4KB{0}[Build] [496]。/out/js/EditExerciseCategoryPropertiesPanel.js 5.78 kB{0}[Build] [497]./out/js/EditExerciseMainPropertiesPanel.js 4.91 kB{0}[Build] [498]./out/js/ExercicesTopLevelView.js 13.7kb{0}[builded] [502]./out/js/LogHelper.js 791字节{0}[builded] [504]。/out/js/asynccognito.js 2.08 kB{0}[Build] [505]./out/js/index.js 599字节{0}[builded] +491隐藏模块

我做错了,但我找不到是什么


非常感谢您的帮助。

好的,在重新安装节点模块时,我收到了一条警告消息,该消息使我找到了解决方案:

npm警告不推荐的吞咽-webpack@1.5.0:重命名为

所以我切换到这个模块,在删除了不推荐使用的进度配置选项后,它立即工作了