Caching with Webpack, [hash] value inside index source code, using React.js

后端 未结 3 1566
情深已故
情深已故 2021-02-06 11:33

I\'m building an isomorphic application. It is completely built with react -- namely, the html base is also in react.

I have my root html as an app component.

It

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-06 11:42

    Instead of trying to render it in the app, I found the best solution is to pass the webpack assets into the app. This can be either directly through props or through your flux.

    That way your code is rendered with a variable. The value of your variable is irrelevant for the build process.

    ...
    var AppTemplate = React.createClass({
        displayName: 'AppTemplate',
        render: function() {
            return (
                
                        
                            hello
                            
                        
                        
                            
                            
    
                                     
                  
提交回复
热议问题