import imageFile from "./happy-image.svg";
export default ()=> <img src={imageFile} alt="happy image" />;
obs.: Image does exist and it is on the same directory
module.exports = {
webpack: (config, { dev }) => {
config.resolve = config.resolve || {};
config.resolve.symlinks = false;
config.module.rules.push(
{
test: /\.(gif|svg)(\?.*)?$/i,
use: [
{
loader: "emit-file-loader",
options: {
name: "dist/[path][name].[ext]",
},
},
{
loader: "file-loader",
options: {
limit: 1000,
},
},
],
});
}
}
Component get rendered with correct image url
Error: ReferenceError: __webpack_public_path__ is not defined
module.exports = __webpack_public_path__ + "[hash].svg";*.note __webpack_public_path__ was not defined anywhere
| Tech | Version |
|---------|---------|
| next | v2.4.9 |
| node | v8.2.0 |
| OS | OSX SIERRA |
Currently we don't support custom webpack loaders. But we may need to do it in the future.
What a shame.
Most helpful comment
What a shame.