这就是我的代码:
$('.mainSpan:before').css('background','url(_gfx/cmn/main_bg.png)');
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用所以我问是否有可能使用jQuery将背景图像添加到阴影元素.
我正在使用 Webpack Validator 来验证我的 Webpack Config 对象,它给了我以下错误:
[1] "loader" must be a string
Run Code Online (Sandbox Code Playgroud)
这是我的 Webpack 配置对象:
const config = webpackValidator({
context: resolve('client'),
entry: {
app: './app.js',
vendor: ['./app.css'],
},
output: {
filename: ifProd('bundle.[name].[chunkhash].js', 'bundle.[name].js'),
path: resolve('dist'),
pathinfo: ifNotProd(),
},
devtool: ifProd('source-map', 'eval'),
module: {
loaders: [
{test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/},
{test: /\.jsx$/, loaders: ['babel-loader'], exclude: /node_modules/},
{
test: /\.css$/, loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader'
})
},
],
},
plugins: removeEmpty([
new ProgressBarPlugin(),
new ExtractTextPlugin(ifProd('styles.[name].[chunkhash.css]', 'styles.[name].css')),
ifProd(new InlineManifestWebpackPlugin()), …Run Code Online (Sandbox Code Playgroud)