twig-html-loader icon indicating copy to clipboard operation
twig-html-loader copied to clipboard

Add webpack 5 support

Open radiocity opened this issue 5 years ago • 4 comments

https://webpack.js.org/blog/2020-10-10-webpack-5-release/

radiocity avatar Nov 06 '20 19:11 radiocity

Hi @radiocity,

Any news on this?

I have test the loader with webpack@5 and it looks like it's working fine. However, raw-loader is now deprecated, so you may have to take a look at asset modules, see https://webpack.js.org/guides/asset-modules/.

Thanks for your feedback! :wink:

xavierfoucrier avatar Jul 17 '21 11:07 xavierfoucrier

Adjusting the webpack configuration and drop raw-loader works fine, even with the current twig-html-loader version:

module.exports = () => ({
  module: {
    rules: [
      {
        test: /\.twig$/,
        exclude: /node_modules/,
        type: 'asset/source', // <-- with new asset-modules
        use: [
          {
            loader: 'twig-html-loader',
            options: {
              ...

As a side note, what about project 1.0.0 ?.. is it definitely closed? :thinking:

xavierfoucrier avatar Aug 06 '21 14:08 xavierfoucrier

@xavierfoucrier, the project will develop as I find the strength to work on weekends :C

radiocity avatar Aug 08 '21 08:08 radiocity

Hi @radiocity,

I totally understand what you mean :smile: No problem, feel free to give a feedback when you need to test something with webpack 5.

Cheers! :beers:

xavierfoucrier avatar Aug 10 '21 11:08 xavierfoucrier