0

私はWindowsデベロッパーシステムでwebpackとnode.jsをテストしています。 私は、次のエラーが表示さプロダクションタグでのWebPACKを呼び出すと、私はこのスクリプト「webpack.config.js」Webpack最適化コンストラクタが見つかりません

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

module.exports = { 
    context: __dirname, 
    devtool: debug ? "inline-sourcemap" : null, 
    entry: "./js/scripts.js", 
    output: { 
    path: __dirname + "/js", 
    filename: "scripts.min.js" 
    }, 
    plugins: debug ? [] : [ 
    new webpack.optimize.DedupePlugin(), 
    new webpack.optimize.OccurenceOrderPlugin(), 
    new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), 
    ], 
}; 

を持っている:私は、内のノードのコンソールからconsole.log(require('webpack'));を実行したときしかし、

C:\Users\srussell\Desktop\GitHub\nodejsTest\webpack.config.js:14 
    new webpack.optimize.OccurenceOrderPlugin(), 
    ^

TypeError: webpack.optimize.OccurenceOrderPlugin is not a constructor 
    at Object.<anonymous> (C:\Users\srussell\Desktop\GitHub\nodejsTest\webpack.config.js:14:5) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 
    at Function.Module._load (module.js:438:3) 
    at Module.require (module.js:497:17) 
    at require (internal/module.js:20:19) 
    at requireConfig (C:\Users\srussell\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:96:18) 
    at C:\Users\srussell\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:109:17 

をcmdは、私はwebpackがインストールされていることを示し、最適化機能とメソッドが利用可能です。

C:\Users\srussell\Desktop\GitHub\nodejsTest>node 
> console.log(require('webpack')); 
{ [Function: webpack] 
    WebpackOptionsDefaulter: [Function: WebpackOptionsDefaulter], 
    WebpackOptionsApply: [Function: WebpackOptionsApply], 
    Compiler: { [Function: Compiler] Watching: [Function: Watching] }, 
    MultiCompiler: [Function: MultiCompiler], 
    NodeEnvironmentPlugin: [Function: NodeEnvironmentPlugin], 
    validate: [Function: bound validateSchema], 
    validateSchema: [Function: validateSchema], 
    WebpackOptionsValidationError: [Function: WebpackOptionsValidationError], 
    DefinePlugin: [Getter], 
    NormalModuleReplacementPlugin: [Getter], 
    ContextReplacementPlugin: [Getter], 
    IgnorePlugin: [Getter], 
    WatchIgnorePlugin: [Getter], 
    BannerPlugin: [Getter], 
    PrefetchPlugin: [Getter], 
    AutomaticPrefetchPlugin: [Getter], 
    ProvidePlugin: [Getter], 
    HotModuleReplacementPlugin: [Getter], 
    SourceMapDevToolPlugin: [Getter], 
    EvalSourceMapDevToolPlugin: [Getter], 
    EvalDevToolModulePlugin: [Getter], 
    CachePlugin: [Getter], 
    ExtendedAPIPlugin: [Getter], 
    ExternalsPlugin: [Getter], 
    JsonpTemplatePlugin: [Getter], 
    LibraryTemplatePlugin: [Getter], 
    LoaderTargetPlugin: [Getter], 
    MemoryOutputFileSystem: [Getter], 
    ProgressPlugin: [Getter], 
    SetVarMainTemplatePlugin: [Getter], 
    UmdMainTemplatePlugin: [Getter], 
    NoErrorsPlugin: [Getter], 
    NoEmitOnErrorsPlugin: [Getter], 
    NewWatchingPlugin: [Getter], 
    EnvironmentPlugin: [Getter], 
    DllPlugin: [Getter], 
    DllReferencePlugin: [Getter], 
    LoaderOptionsPlugin: [Getter], 
    NamedModulesPlugin: [Getter], 
    HashedModuleIdsPlugin: [Getter], 
    ModuleFilenameHelpers: [Getter], 
    optimize: 
    { AggressiveMergingPlugin: [Getter], 
    AggressiveSplittingPlugin: [Getter], 
    CommonsChunkPlugin: [Getter], 
    ChunkModuleIdRangePlugin: [Getter], 
    DedupePlugin: [Getter], 
    LimitChunkCountPlugin: [Getter], 
    MinChunkSizePlugin: [Getter], 
    OccurrenceOrderPlugin: [Getter], 
    UglifyJsPlugin: [Getter] }, 
    dependencies: {} } 
undefined 

ご協力いただきましてありがとうございます。プロジェクトへのリンクがあれば、ここにリンクがあります。 https://github.com/russellsean/nodejsTest

答えて

2

愚かな私...発生には2つの 'r'文字があり、最初は1つありました。

関連する問題