wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

How can I use react-template with Laravel Mix? #259

Open hurano opened 3 years ago

hurano commented 3 years ago

How can I use react-template with Laravel Mix?

I tried this setting but it doesn't work. Is anyone who can make it work with Laravel Mix?

My code:

mix.setPublicPath('/')
    .webpackConfig({
      module: {
        loaders: [
                { test: /\.rt$/, loader: "react-templates-loader?modules=amd" },
            ]
      },
    })
    .react('resources/js/app.js', 'public/js')
    .version()
    .sourceMaps()
    .sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: true
    });

Thanks.