Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely slow Compiled Successfully in 459681ms #3390

Open
elrosi opened this issue Jun 25, 2024 · 2 comments
Open

Extremely slow Compiled Successfully in 459681ms #3390

elrosi opened this issue Jun 25, 2024 · 2 comments

Comments

@elrosi
Copy link

elrosi commented Jun 25, 2024

  • Laravel Mix Version: 6.0.49 (npm list --depth=0)
  • Node Version (node -v): v20.15.0
  • NPM Version (npm -v): 10.7.0
  • webpack : "^5.92.1",
  • sass: "^1.55.0",
  • sass-loader : "^14.2.1",
  • OS: WIN 10

Hi friends, I'm compiling JS, TS and SCSS in Laravel 10. Since some point the compilation mix watch initialization goes extremely slow. The initial compilation of the code takes more than 5 minutes. It gets stuck at 10%
building (10%) 0/3 entries 1/3 dependencies 0/1 modules 1 active
babel-loader ' ts-loader ' resources\src\js\app.ts and at 92%

Can you advise me if this problem is in some JS package or in the code that slows down the compiler.
Thank you for your suggestions.

My webpack.mix.js:

const mix = require('laravel-mix');
const webpack = require('webpack');
const glob = require('glob');
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');

const mode = process.argv.indexOf("production") !== -1 ? "production" : "development";
console.log(Webpack mode: ${mode});
console.log(Webpack not in production: + !mix.inProduction());

let plugins = [
new VueLoaderPlugin(),
new webpack.DefinePlugin({
VUE_OPTIONS_API: true,
VUE_PROD_DEVTOOLS: false,
VUE_PROD_HYDRATION_MISMATCH_DETAILS: false
})
];

mix.webpackConfig({
devtool: 'inline-source-map',
plugins: plugins,
watchOptions: {
ignored: /node_modules/,
},
ignoreWarnings: [{
module: /esri-leaflet/,
message: /version/,
}],
resolve: {
alias: {
"@": path.resolve(__dirname, 'resources/src/js'),
"@core": path.resolve(__dirname, 'resources/_keenthemes/src'),
"@quotioo": path.resolve(__dirname, 'resources/quotioo'),
"vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
extensions: [".*", ".wasm", ".mjs", ".jsx", ".json", ".ts", ".js", ".tsx", ".vue"]
}
},
module: {
rules: [
{
test: /.css$/i,
use: ["css-loader"],
exclude: [
path.resolve(__dirname, "node_modules"),
],
},
],
}
});

// Build Metronic CSS
mix
.options({
processCssUrls: false
})
.scripts(require('./resources/mix/plugins.js'), 'public/quotioo/js/plugins.bundle.js')
.scripts(require('./resources/mix/scripts.js'), 'public/quotioo/js/scripts.bundle.js')
.scripts(require('./resources/quotioo/js/scripts.js'), 'public/quotioo/js/app.scripts.bundle.js');

// Build custom 3rd party plugins
console.log('-- Build custom 3rd party plugins --');
(glob.sync(resources/mix/vendors/!**!/!*.js) || []).forEach(file => {
mix.scripts(require('./' + file), public/assets/${file.replace(path.normalize('resources/mix/vendors/'), 'plugins/custom/')});
});

// JS pages (single page use)
console.log('-- JS pages (single page use) --');
(glob.sync(resources/quotioo/js/custom/!**!/!*.js) || []).forEach(file => {
let output = ${file.replace(path.normalize(quotioo/js/custom), quotioo/js/custom).replace('resources', 'public')};
mix.scripts(file, output);
});

// Custom app styles and javascript,
console.log('-- Custom app styles and javascript --');
mix.sass(resources/_keenthemes/src/sass/style.scss, public/quotioo/css/style.bundle.css);
mix.sass(resources/quotioo/scss/style.scss, public/quotioo/css/style.css)
.sourceMaps(!mix.inProduction());

mix
.ts('resources/src/js/app.ts', 'public/app/js')
.vue({
version: 3,
})
.sourceMaps(!mix.inProduction())
.disableNotifications();

Steps To Reproduce:

@MrSuddenJoy
Copy link

First off: this propject is nearly dead so o not expect quick answer.
Second: main "contributor" is @JeffreyWay (creator of laracasts) and you know the "quality" of laracasts. Same quality here.
Third: use code-block to wrap code. Greatly improves readibility.

@szwss
Copy link

szwss commented Jun 29, 2024

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants