{"action":"closed","issue":{"url":"https://api.github.com/repos/at0g/nunjucks-loader/issues/66","repository_url":"https://api.github.com/repos/at0g/nunjucks-loader","labels_url":"https://api.github.com/repos/at0g/nunjucks-loader/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/at0g/nunjucks-loader/issues/66/comments","events_url":"https://api.github.com/repos/at0g/nunjucks-loader/issues/66/events","html_url":"https://github.com/at0g/nunjucks-loader/issues/66","id":332439149,"node_id":"MDU6SXNzdWUzMzI0MzkxNDk=","number":66,"title":"Images handling in nunjucks template","user":{"login":"wollsale","id":6388076,"node_id":"MDQ6VXNlcjYzODgwNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6388076?v=4","gravatar_id":"","url":"https://api.github.com/users/wollsale","html_url":"https://github.com/wollsale","followers_url":"https://api.github.com/users/wollsale/followers","following_url":"https://api.github.com/users/wollsale/following{/other_user}","gists_url":"https://api.github.com/users/wollsale/gists{/gist_id}","starred_url":"https://api.github.com/users/wollsale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wollsale/subscriptions","organizations_url":"https://api.github.com/users/wollsale/orgs","repos_url":"https://api.github.com/users/wollsale/repos","events_url":"https://api.github.com/users/wollsale/events{/privacy}","received_events_url":"https://api.github.com/users/wollsale/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-14T14:55:12Z","updated_at":"2018-06-14T15:10:23Z","closed_at":"2018-06-14T15:10:23Z","author_association":"NONE","body":"Hi all !\r\n\r\nI'm using nunjucks-loader (and nunjucks) for the first time in a Webpack based project, everything works fine, but I can not load images inside a `.njk` file.\r\n\r\nI'm using file-loader, which works fine with HTML files.\r\n\r\nAm I missing something? (My webpack configuration is attached below)\r\n\r\nThanks in advance,\r\n\r\nAW.\r\n\r\n\r\n```\r\nconst path = require('path');\r\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\r\nconst CleanWebpackPlugin = require('clean-webpack-plugin');\r\nconst CopyWebpackPlugin = require('copy-webpack-plugin');\r\nconst NunjucksWebpackPlugin = require('nunjucks-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    entry: {\r\n        main: './src/index.js'\r\n    },\r\n    output: {\r\n        path: path.resolve(__dirname, 'dist'),\r\n        filename: '[name].js'\r\n    },\r\n    devServer: {\r\n        contentBase: path.join(__dirname, \"dist\"),\r\n        compress: true,\r\n        port: 9999\r\n    },\r\n    optimization: {\r\n        minimize: false\r\n    },\r\n    resolve: {\r\n        modules: ['node_modules']\r\n    },\r\n    module: {\r\n        rules: [\r\n            {\r\n                test: /\\.js$/,\r\n                exclude: /node_modules/,\r\n                use: {\r\n                    loader: \"babel-loader\"\r\n                }\r\n            },\r\n            {\r\n                test: /\\.scss$/,\r\n                use:  [  \r\n                    'style-loader', \r\n                    MiniCssExtractPlugin.loader, \r\n                    'css-loader',\r\n                    'postcss-loader',\r\n                    'sass-loader'\r\n                ]\r\n            },\r\n            {\r\n                test: /\\.html$/,\r\n                use: ['html-loader']\r\n            },\r\n            {\r\n                test: /\\.(njk|nunjucks)$/,\r\n                use: [\r\n                    {\r\n                        loader: 'nunjucks-loader'\r\n                    }\r\n                ],\r\n            },\r\n            {\r\n                test: /\\.(png|jpg|gif|svg)$/,\r\n                use: [\r\n                    {\r\n                        loader: 'file-loader',\r\n                        options: {\r\n                            name: '[name].[ext]',\r\n                            outputPath: './assets/images'\r\n                        }\r\n                    }\r\n                ]\r\n            },\r\n            {\r\n                test: /\\.(woff|woff2|eot|ttf|otf)$/,\r\n                use: [\r\n                    {   loader: 'file-loader',\r\n                        options: {\r\n                            name: '[name].[ext]',\r\n                            outputPath: 'assets/fonts'\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        ]\r\n    },\r\n    plugins: [ \r\n        require('autoprefixer'),\r\n        new CleanWebpackPlugin('dist', {} ),\r\n        new MiniCssExtractPlugin({\r\n            filename: 'style.css',\r\n        }),\r\n        new NunjucksWebpackPlugin({\r\n            templates: [\r\n                {\r\n                    from: \"./src/views/pages/homepage.njk\",\r\n                    to: \"index.html\"\r\n                }\r\n            ]\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nThe `img` tag: \r\n```\r\n// This file exist, this path is correct\r\n<img src=\"./assets/images/logo.png\" alt=\"\">\r\n```"}}
{"actor":{"display_login":"wollsale"}}