我的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'表达式限制为您希望每个加载器执行的文件类型。 –