webpackに関する問題があります。それはうまく構築されますが、私は私のサイトを開くとき、私は得る:Getting error: "Uncaught ReferenceError: webpackJsonp is not defined"
Webpackビルドエラー
私のCommonsChunkPluginは私のアプリがバンドルされる前に実行されていると思う?
dist/js/
に構築されているsrc/config/webpack.config.js
に私の設定があることを知るのに役立つかもしれません。
https://medium.com/@MarkEwersDev/note-to-self-if-you-ever-get-this-uncaught-referenceerror-webpackjsonp-is-not-defined-message-and-d354f5c4d335#.9cysuil5pとhttps://github.com/webpack/webpack/issues/368を読んだことがありますが、私は何か不足していない限りどちらも役に立ちません。
devtool: 'source-map',
entry: {
vendor: [
'react', 'react-dom', 'react-router', 'react-helmet', 'react-redux', 'moment-timezone', 'cookies-js', 'superagent', 'classnames', 'es6-promise'
],
app: [
'./src/client/entry',
'./scss/main.scss',
]
}
output:{
path: __dirname + '../../dist/js',
filename: 'app.js'
}
plugins:[
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new ExtractTextPlugin('../css/app.css', {
allChunks: true
}),
new webpack.DefinePlugin({
'process.env':{
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: true
},
output: {
comments: false
}
}),
...persistentPlugins
],
私は間違った順序でスクリプトを読み込んでいたようです。これでwebpackJsonpエラーが修正されました。 私のヘッダーだけがロードされていますが、私のコンソールやサーバーのログには何のエラーもありません。 – Stretch0
polyfills.js、vendor.js、app.jsをロードする必要があります – klonq