Nuxt SPA with Pre Rendered static content HTML - vue.js

I'm using nuxt generate --spa to build out my files into my dist folder. It is creating the actual .html files like products/product.html however it is still chunking the files in javascript script tags.
<script type="text/javascript" src="/_nuxt/890d3a2acad1dc557c61.js"></script>
I also have my app set as 'spa' mode in nuxt.config.js
export default {
mode: 'spa',
}
How can I set nuxt to generate the required html files and to acutally generate static .html code in the source code when you view the website in the browser?

Related

How to set nuxt static page rendering with bootstrap and scss

I am currently merging a project from server-side rendering to static page rendering. According to the docs since nuxt 2.13 You can set the target to static inside of nuxt.config and run nuxt generate. This is correctly generating an html file for each file within my pages folder, however my pages lack all the styles. I am not sure if this behavior is expected or if I am missing something. I am currently using scss and bootstrap for the project. Any help would be appreciated.

Vue Cli 4 not copying index.html to output path

I need to copy the index.html in public to a specific folder defined in public path, but this is not working as I expect.
I also don't want the cli to include header and scripts references in the html file.
My index html output should contains only: <div id='app'></div> plus some specific html tags required by our CMS system.
For that I use:
chainWebpack: config => {
// disable splitting of JS files for dist folder
config.optimization.delete('splitChunks')
config.plugins
.delete('html')
.delete('prefetch')
.delete('preload')
}
But my index.html is not being copied to my output path.
If I remove .delete('html'), index.html will copy normally, but with headers and script references.
I had the same with Vue Cli 3 and this used to work. What am I missing?

Run Aurelia CLI app from a directory

I would like to deploy my app to a virtual directory. I have been unable to figure out the correct configuration needed to run the app locally with a similar structure. For example, I'd like to run it from:
http://localhost:8080/demos
I have tried every combination of adding "demos" to publicPath and contentBase in my webpack config. The errors just between 404's on static assets and router errors from Aurelia.
It is documented by Aurelia router, you can add base tag to index.html header, <base href="/demos">, and set router root config.options.root = "/demos"; in configureRouter().
In addition, if your bundled js files are indeed served from directory, you need to modified baseDir in 2 places of aurelia.json: platform.baseDir and build.targets[0].baseDir.

How to get assets files url in yii?

I added CKEditor to my yii webApp and now i have problem with filebrowserBrowseUrl attribute,
What should i put instead of 4db59eda folder? Or how can i get assets files and folders url?
Thanks.
<script type="text/javascript">
CKEDITOR.replace( 'Projects_content',
{
filebrowserBrowseUrl :'http://localhost/altin/assets/4db59eda/filemanager/browser/default/browser.html?Connector=http://localhost/altin/assets/4db59eda/filemanager/connectors/php/connector.php',
At my project I've included the files in a folder called "js" at app root. It's at the same level of protected, css and etc.
You can add your scripts to your page like the following example:
$baseUrl = Yii::app()->baseUrl;
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($baseUrl.'/js/yourscript.js');
The best way to use URL's at the Yii is with Yii::app()->baseUrl.

Prevent specific css and js file from being cached htacesss

How can i use the htacess from caching my main.css and main.js file. However i use multiple js files and css files like so
css --- main.css dafault.css new.css
js --- main.js acc.jss new.js
what i want to do is prevent the caching of only main.css and main.js how can i do that but the rest of the css files as well as the js files should be cached
Make the script & css references versioned. add a date time string at the end of file extension with ? mark.
Ex:
<script src = "main.js?ver=" + dateTimeNow />