我的React網絡應用程序可以與wabpack
之前添加url-loader
。反應Web應用程序顯示空白或不添加後添加Url-loader
但是,當我添加url-loader
它顯示爲空或不顯示任何東西。
MY Project File Link with Github
MY webpack.config.js
文件
module: {
// After add this code app show blank
// ************************************
loaders: [
{
test: /\.(js|.jsx|jpe?g|png|gif|svg|woff|woff2|eot|ttf)$/i, // a regular expression that catches .js files
exclude: /node_modules/,
loader: 'url-loader',
},
// **************************
{
test: /\.(js|.jsx|jpe?g|png|gif|svg|woff|woff2|eot|ttf)$/i,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['react','es2016', 'stage-0',],
plugins: ['react-html-attrs', 'transform-decorators-legacy', 'transform-class-properties'],
}
},
]
},
CONSOLE.LOG
Webpack是否顯示任何錯誤?你的網頁瀏覽器是否有錯誤? – lilezek
@lilezek no hare no error show console .. –
你爲什麼要在JavaScript文件上使用'url-loader'?爲什麼你要在圖像文件上使用'babel-loader'?將您的'test'表達式限制爲您希望每個加載器執行的文件類型。 –