Filipe Dos Santos Mendes

Results 23 comments of Filipe Dos Santos Mendes

I was going to ask for this, very nice to see this in your backlog! This would allow the use of many libs without the hassle of CJS default exports...

Thank you very much! I'll throw myself into the Webpack docs and hopefully will be able to help you out with this. Have a nice day!

Hiya, I think I know how to do this (thanks to [the docs](https://webpack.js.org/contribute/writing-a-loader/#module-dependencies)) but first, can you explain a bit how's the code working? In fact, I only use it...

Wow, thank you very much for taking the time to explain this to me! Will read this and start coding this weekend. Oh time, if only we could get more...

So, I gave this a try and for now I'm stuck with paths from HtmlWebpackPlugin. I chose the following syntax as it is valid nunjucks: `{{ require('./asset.jpg') }}` considering `require`...

Well, my bad. Here's the right way to require the needed asset: ``` // Search for require macros templateAsString = templateContent.replace( /\{\{\s*require\([\'\"]{1}(.+)[\'\"]{1}\)\s*\}\}/, function (match, $1) { console.log(path.resolve(paths[0], $1)); // return...

Thank you @superjose ! This was helpful but I still got a little issue here. I cannot manage to pass data from webpack to the templates. Even `htmlWebpackPlugin.options` isn't available....

@superjose I finally tried another loader, details [on stackoverflow](https://stackoverflow.com/questions/47335302/using-nunjucks-with-htmlwebpackplugin-using-dynamic-vars-in-the-template)

> @lostfictions I believe this can be resolved by adding `export type * from "./util.js"` to `index.ts`. > > Typescript can only reference types explicitly exported in [package.json](https://github.com/lostfictions/znv/blob/1cc9558c1218d263bca8484f4d8862c8eb2074e0/package.json#L28). > >...

As a workaround, I added a `.d.ts` file to fix original types which are too loose: ```ts // eslint-plugin-react.d.ts declare module 'eslint-plugin-react' { export const configs: typeof configs & {...