We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in the folder /app/el/ exsist file logo.png ./app/el/btn.less
/app/el/
logo.png
./app/el/btn.less
@import (reference) "~app/mixin/sprite.less"; .btn { .sprite('./logo.png'); }
./app/mixin/sprite.less
.sprite(@file, @spriteName: 'sprite') { width: image-width(@file); height: image-height(@file); background: url("@{file}#@{spriteName}"); }
error:
ERROR in ./~/css-loader?sourceMap!./~/postcss-loader?sourceMap!./~/less-loader?sourceMap!./app/el/btn.less Module build failed: error evaluating function `image-width`: './logo.png' wasn't found. Tried - /Users/DragorWW/test-app/app/mixin/logo.png,logo.png
if not use mixin in ./app/el/btn.less, all is well.
.btn { width: image-width('./logo.png'); height: image-height('./logo.png'); background: url('./logo.png'); }
webpack.config.js
module.exports = { context: path.join(__dirname, 'app'), module: { loaders: [ { test: /\.less$/, loader: ExtractTextPlugin.extract('style','css?sourceMap!postcss?sourceMap!less?sourceMap') }, { test: /\.(jpe?g|png|gif|svg)$/i, loaders: [ 'url?limit=5000&name=images/[name]-[hash:6].[ext]' ] }, ] }, resolve: { alias: { app: path.join(__dirname, '/app') }, }, plugins: [ new ExtractTextPlugin('styles.css'), ], };
The text was updated successfully, but these errors were encountered:
image-width
image-height
image-size
I have the same problem ..Is there some workaround?
Sorry, something went wrong.
No branches or pull requests
in the folder
/app/el/
exsist filelogo.png
./app/el/btn.less
./app/mixin/sprite.less
error:
if not use mixin in
./app/el/btn.less
, all is well.webpack.config.js
The text was updated successfully, but these errors were encountered: