Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to export the project


Hi, im using demo1 app for my personal use, i downloaded it and made a lot of changes(added new pages etc)
So Im trying to export this project for publish
vite.config.ts file
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

//
export default defineConfig({
plugins: [react()],
base: "/metronic8/react/demo1/",
build: {
chunkSizeWarningLimit: 3000,
},
})
Then I run this command
npm run build
..
dist/assets/WidgetsPage-bb75ee96.js 193.01 kB │ gzip: 14.57 kB
dist/assets/index-ec788f2a.js 2,700.60 kB │ gzip: 744.17 kB
✓ built in 27.99s
it gots success, but in dist/index.html file is almost empty, can see anything but
Keenthemes dark logo Keenthemes light logo
Loading...
this,

I can see everything with this command
npm run preview


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (9)


Hi,

Thank you for reaching out to us.

It sounds like you are trying to deploy your application, to test the production build locally you should run npm run build to build an application, the build output will be placed in dist folder in the root of your project, then to preview production build you can run npm run preview. Later dist folder can be deployed to our server.

By default, our previews are served under /metronic8/react/demo1/, when you deploy Metronic on your server, you should update base property up to the path on your server in file vite.config.js. If you do not have a nested folder on your server then you can set base path to /.

You can read more about this property in the official documentation:

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi, I tryed this
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

//
export default defineConfig({
plugins: [react()],
base: "/",
build: {
chunkSizeWarningLimit: 3000,
},
});


it exports himself but, index.html is not shows anything, how can I share screenshot, I need helpimport { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

//
export default defineConfig({
plugins: [react()],
base: "/",
build: {
chunkSizeWarningLimit: 3000,
},
});
I uploaded the ss with lightshot





Hi,

Thank you for reaching out to us.

You cannot open index.html due to the way modern JavaScript frameworks handle development and deployment.

For the development to run the application you have to use the command npm run dev, for production use npm run build.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



You cannot open index.html due to the way modern JavaScript frameworks handle development and deployment.
I'm trying this after the deployment



I really need help, can we connect ?



Please check this out



Hi,

It looks like your application just refers to the index.html file directly, which is not correct. Please see this official guide on how you can deploy Vite Vue application to Netify.


Regards,
Lauris Stepanovs,
Keenthemes Support Team



ailed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.



Hi,

Unfortunately, we were not able to reproduce this error in the latest Metroinc 8 version.

You can try solution suggested in this post:

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(