{"action":"closed","issue":{"url":"https://api.github.com/repos/zimmo-be/twig-loader/issues/20","repository_url":"https://api.github.com/repos/zimmo-be/twig-loader","labels_url":"https://api.github.com/repos/zimmo-be/twig-loader/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/zimmo-be/twig-loader/issues/20/comments","events_url":"https://api.github.com/repos/zimmo-be/twig-loader/issues/20/events","html_url":"https://github.com/zimmo-be/twig-loader/issues/20","id":170897254,"number":20,"title":"How to use Namespacing with TwigJS in webpack ?","user":{"login":"ethyde","id":409987,"avatar_url":"https://avatars.githubusercontent.com/u/409987?v=3","gravatar_id":"","url":"https://api.github.com/users/ethyde","html_url":"https://github.com/ethyde","followers_url":"https://api.github.com/users/ethyde/followers","following_url":"https://api.github.com/users/ethyde/following{/other_user}","gists_url":"https://api.github.com/users/ethyde/gists{/gist_id}","starred_url":"https://api.github.com/users/ethyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethyde/subscriptions","organizations_url":"https://api.github.com/users/ethyde/orgs","repos_url":"https://api.github.com/users/ethyde/repos","events_url":"https://api.github.com/users/ethyde/events{/privacy}","received_events_url":"https://api.github.com/users/ethyde/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-12T15:28:32Z","updated_at":"2016-08-15T15:41:34Z","closed_at":"2016-08-15T15:41:34Z","body":"Hi,\r\n\r\nI am facing a strange bug.\r\n\r\nI try to use Express Webpack + + + HMR Twig .\r\n\r\nI try to define a namespace like that :\r\n```\r\napp.set('twig options', {\r\n    strict_variables: false,\r\n    namespaces: { 'pmd': './src/views/' }\r\n});\r\n```\r\nand then use in template as :\r\n```\r\n{% extends 'pmd::layout.html.twig' %}\r\n```\r\nBut when the server is started I have to generate a module error with Twig file and correct it. And after that all wwork like a charm ... \r\n\r\nFrom terminal :\r\n```\r\n➜  StarterPack git:(feature/SP-01) ✗ npm run server\r\n\r\n> pmd@0.0.3 server /Users/eplouvie/Projects/Labs/StarterPack\r\n> node server.js\r\n\r\n[BS] Proxying: http://localhost:9000\r\n[BS] Access URLs:\r\n ------------------------------------\r\n       Local: http://localhost:3000\r\n    External: http://172.19.11.8:3000\r\n ------------------------------------\r\n          UI: http://localhost:3001\r\n UI External: http://172.19.11.8:3001\r\n ------------------------------------\r\n[BS] Watching files...\r\nwebpack built 8e3ee2f107e8e2989358 in 3810ms\r\nVersion: webpack 1.13.1\r\nTime: 3810ms\r\n                      Asset     Size  Chunks             Chunk Names\r\n    ./assets/img/sample.jpg   355 kB          [emitted]\r\n./assets/img/background.jpg  79.1 kB          [emitted]\r\n             assets/main.js  1.06 MB       0  [emitted]  main\r\nwebpack: bundle is now VALID.\r\n[BS] File changed: src/views/components/home/config.js\r\nwebpack: bundle is now INVALID.\r\nwebpack: wait until bundle finished: /\r\nwebpack building...\r\nwebpack built 6e8a6eeea1660c993edd in 1538ms\r\nVersion: webpack 1.13.1\r\nTime: 1538ms\r\n                               Asset      Size  Chunks             Chunk Names\r\n             ./assets/img/sample.jpg    355 kB          [emitted]\r\n         ./assets/img/background.jpg   79.1 kB          [emitted]\r\n                      assets/main.js   1.75 MB       0             main\r\n0.8e3ee2f107e8e2989358.hot-update.js    693 kB       0             main\r\n8e3ee2f107e8e2989358.hot-update.json  36 bytes\r\n\r\nERROR in ./src/views/components/home/index.html.twig\r\nModule not found: Error: Cannot resolve module 'pmd::layout.html.twig' in /Users/eplouvie/Projects/Labs/StarterPack/src/views/components/home\r\n @ ./src/views/components/home/index.html.twig 3:0-32\r\nwebpack: bundle is now VALID.\r\n[BS] File changed: src/views/components/home/config.js\r\nwebpack: bundle is now INVALID.\r\nwebpack: wait until bundle finished: /\r\nwebpack building...\r\nwebpack built 28bee64d6516158bfb95 in 425ms\r\nVersion: webpack 1.13.1\r\nTime: 425ms\r\n                               Asset      Size  Chunks             Chunk Names\r\n             ./assets/img/sample.jpg    355 kB\r\n         ./assets/img/background.jpg   79.1 kB\r\n                      assets/main.js   1.06 MB       0  [emitted]  main\r\n8e3ee2f107e8e2989358.hot-update.json  35 bytes          [emitted]\r\nwebpack: bundle is now VALID.\r\n```\r\n I have try to force reload with :\r\n```\r\nbundler.plugin('done', function (stats) {\r\n     browserSync.reload();\r\n});\r\n```\r\nAnd with Express 3 or Nodemon.\r\n\r\nSo I think there a loading/init problem when using namespacing.\r\n\r\nWhat can i do to make that properly ?\r\n\r\nThanks.\r\n\r\nIf needed, you can checkout all my project : https://github.com/ethyde/StarterPack/tree/feature/SP-01"}}
{"actor":{"display_login":"webberig"}}