2016-05-02 18 views
1

私は反応(JSX)でコードを書き、webpack(babelを使用)で変換しています。Webpackを使用しているときにエラーが発生しました-p

"scripts": { 
"production": "webpack -p" 
} 

と私は、コマンドライン上のNPMの実行生産を実行していることだし、これは私が得るものです:私はこれに私の「package.json」ファイルの一部を変更した

> [email protected] production D:\Nave\MyProjects\ReactJs\React-Fundamentals 
> webpack -p 

webpack 1.13.0 
Usage: https://webpack.github.io/docs/cli.html 

Options: 
    --help, -h, -? 
    --config 
    --context 
    --entry 
    --module-bind 
    --module-bind-post 
    --module-bind-pre 
    --output-path 
    --output-file 
    --output-chunk-file 
    --output-named-chunk-file 
    --output-source-map-file 
    --output-public-path 
    --output-jsonp-function 
    --output-pathinfo 
    --output-library 
    --output-library-target 
    --records-input-path 
    --records-output-path 
    --records-path 
    --define 
    --target 
    --cache                       [default: true] 
    --watch, -w 
    --watch which closes when stdin ends 
    --watch-aggregate-timeout 
    --watch-poll 
    --hot 
    --debug 
    --devtool 
    --progress 
    --resolve-alias 
    --resolve-loader-alias 
    --optimize-max-chunks 
    --optimize-min-chunk-size 
    --optimize-minimize 
    --optimize-occurence-order 
    --optimize-dedupe 
    --prefetch 
    --provide 
    --labeled-modules 
    --plugin 
    --bail 
    --profile 
    -d         shortcut for --debug --devtool sourcemap --output-pathinfo 
    -p         shortcut for --optimize-minimize 
    --json, -j 
    --colors, -c 
    --sort-modules-by 
    --sort-chunks-by 
    --sort-assets-by 
    --hide-modules 
    --display-exclude 
    --display-modules 
    --display-chunks 
    --display-error-details 
    --display-origins 
    --display-cached 
    --display-cached-assets 
    --display-reasons, --verbose, -v 

Output filename not configured. 

npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "production" 
npm ERR! node v0.12.3 
npm ERR! npm v2.9.1 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] production: `webpack -p` 
npm ERR! Exit status 4294967295 
npm ERR! 
npm ERR! Failed at the [email protected] production script 'webpack -p'. 
npm ERR! This is most likely a problem with the react-fundamentals package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  webpack -p 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls react-fundamentals 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  D:\Nave\MyProjects\ReactJs\React-Fundamentals\npm-debug.log 

は誰をい理由を知っている? これは私の "web.config.js" ファイルされる:

var HtmlWebpackPlugin = require('html-webpack-plugin') 
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({ 
    template: __dirname + '/app/index.html', 
    filename: 'index.html', 
    inject: 'body' 
}); 
module.exports = { 
    entry: [ 
    './app/index.js' 
    ], 
    output: { 
    path: __dirname + '/dist', 
    filename: "index_bundle.js" 
    }, 
    module: { 
    loaders: [ 
     {test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"} 
    ] 
    }, 
    plugins: [HTMLWebpackPluginConfig] 
}; 
+1

名前の変更 'web.config.js'にwebpack.config.js''にスクリプトを変更することができます – lux

答えて

1

のWebPACKは、デフォルトでは、ファイル名のwebpack.config.jsを探します。あなたはそれにあなたの名前を変更したり

のWebPACK -p web.config.js

関連する問題