question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Request] Support for HTML Server Side Includes

See original GitHub issue

Is your feature request related to a problem? Please describe. At the moment the Development Server dose not support HTML Server Side Includes.

Describe the solution you’d like As a developer i want to be able to use HTML Server Side Includes in the index.template.html file.

Describe alternatives you’ve considered Add a config.json file into the statics folder. Which gets generated on the release pipeline for each environment. This is not really nice since on some cloud providers for change a simple configuration you have to push the hole app.

Additional context Environment specific configuration should not be backed into the Build. So on a CI / CD Pipeline i can build my code once and push the artifact to the all my diffrent environments. Production build is the exactly the same as i tested it on staging. So on an enviroment i can just change as example in the Environment Variable the ClientID and every new request on my website uses the new ClientId.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rfox12commented, Jan 7, 2020

@Wenish what you’re asking for is out of the ordinary because the webpack server will only be present in development (not when you have code ready for production).

That being said… you can load webpack plugins in your quasar.conf file. I haven’t tried it but I found https://www.npmjs.com/package/ssi-webpack-plugin

In quasar.conf you can specify a webpack plugin by looking for the extendWebpack(cfg) area, potentially doing something like this:

extendWebpack(cfg) {
   const SSICompileWebpackplugin = require('ssi-webpack-plugin')
   cfg.plugins.push(
        new SSICompileWebpackplugin({
            publicPath: '',
            localBaseDir: '/',
            minify: false,
            proxy:"",//可以使用代理
            pathRewrite:{
                '^api':"xxx",//支持正则替换
            },
            remoteBasePath:"http://baidu.com",//如果传了此参数,则表示从远程http请求中获取ssi文件的内容
            variable:{
                'QUERY_STRING':"test=1",//如果ssi文件地址里有引用变量,如${QUERY_STRING},则会用此参数里的对应key的值替换
            }
        })
}

pardon the Chinese! You would also need to install ssi-webpack-plugin as a dev dependency: npm install ssi-webpack-plugin --save-dev

Again I don’t use this plugin and can’t vouch for it… but that’s the basic idea. Hope it helps.

0reactions
rstoenescucommented, Jan 7, 2020

Solution from @rfox12 seems perfectly valid (thanks @rfox12 !).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apache httpd Tutorial: Introduction to Server Side Includes
Server -side includes provide a means to add dynamic content to existing HTML documents. Support Apache! Introduction; What are SSI? Configuring your server...
Read more >
Server Side Includes - Wikipedia
Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the World Wide Web.
Read more >
Server Side Includes
Server -side includes are directives that can be placed in your HTML file, telling the web server to include additional information in the...
Read more >
Use Server Side Includes - IU KB - Indiana University
Server Side Includes (SSI) are codes you can add to your HTML document that tell the web server to include other content with...
Read more >
Server-side includes (SSI) - University of St Andrews
Server -side includes (SSI) are a mechanism for employing the web server to perform tasks like displaying files as part of other files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found