"npm run build" is slower than "npm run dev"
See original GitHub issueHello, first of all sorry for my English, I use google translate.
When I use “npm run dev”, the translation process is done quickly without any problems, but when I do “npm run build”, the file "php_tr.32683819.js
" loads quite late depending on the internet speed. This causes “keys” to appear in the first opening of the page.
As seen in the picture, “php_tr.32683819.js” file is loaded 2000ms after the page is opened.
Dependencies “laravel-vue-i18n”: “^2.2.2”, “vite”: “^3.0.0”, “vue”: “^3.2.31”
Laravel 9+
vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import i18n from 'laravel-vue-i18n/vite';
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.js',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
i18n(),
],
});
app.js
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
setup({ el, app, props, plugin }) {
const captcheKey = props.initialPage.props.recaptcha_site_key;
const application = createApp({ render: () => h(app, props) })
.use(plugin)
.use(i18nVue, {
resolve: async lang => {
const langs = import.meta.glob('../../lang/*.json');
return await langs[`../../lang/${lang}.json`]();
}
})
...
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Npm run build and watch extremely slow - Stack Overflow
I'm trying to create a basic Tailwind starter project and when I try to run the npm run build or npm run watch...
Read more >npm start build stuff and is too slow · Issue #7684 - GitHub
This basically clean and build the full project and then start it in a dev mode. This command can take forever to run....
Read more >NPM Install Build Step Becomes Extremely Slow, Remedied ...
We have an NPM step in our build definition, which executes the install command. Our overall build takes 15-20ish minutes.
Read more >npm run prod is very slow! - Laracasts
Hello , I try to run npm run prod in the server production, but it's very very very slow (sometimes more than 15...
Read more >npm-run-script
If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
if you want to make sure it is not a “lazyLoad” you can use the
globEager
instead.Check the SSR import suggestion: https://github.com/xiCO2k/laravel-vue-i18n#ssr-server-side-rendering
no problem anytime.