0
我是webpack的新手。使用webpack时PNG不加载
PNG文件未能在我的项目加载,有些SlickGrid插件的使用URL()函数来加载PNG文件如下面给出的,
这里是我的WebPack文件,
/* eslint-env node */
module.exports = {
context: __dirname + '/xyz/static',
entry: {
reactComponents: './bundle/components.js',
history: './js/history/index.js',
slickgrid: './bundle/slickgrid.js',
},
output: {
libraryTarget: 'amd',
path: __dirname + '/xyz/static/js/generated',
filename: '[name].js',
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: [/node_modules/, /vendor/],
use: {
loader: 'babel-loader',
options: {
presets: ['es2015', 'react'],
},
},
}, {
test: /\.css$/,
use: ['style-loader', 'raw-loader'],
}],
},
resolve: {
extensions: ['.js', '.jsx'],
},
};
请让我知道我在这里错过了什么。
SlickGrid是第三方库,为什么我需要更改它的代码? – n33rma
不要改变它的代码,但是我认为webpack配置是你的文件,所以可以尝试改变它 –
对不起,我是webpack的新手,我不理解你最后一句话'并将它用作图像标记中的源代码' – n33rma