-
Notifications
You must be signed in to change notification settings - Fork 807
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
vue-template-compiler installed despite no reference to Vue #1877
Comments
|
Why does |
I do not want to have vue-template-compiler dependency in my package.json file. Can it not be forced to install? |
I would like to see an option to turn this off. In #1891 @JeffreyWay mentioned that Laravel Mix was build with Vue in mind but the current documentation indicates that it's more a universal build tool to make configuration with Webpack easier. Getting vue-template-compiler force installed via Yarn even if I do not use any Vue and not using Yarn is irritating especially for starters. If there is an option to turn this off or properly configure it, I would be pleased to get to know it. :) |
A quick fix that I found that was especially helpful for me was to use the
mix.scripts(['resources/js/app.js'], 'public/js/app.js')
.sass('resources/sass/app.scss', 'public/css'); If you're writing ES6+ JS like I am you can also use the Hope this helps 😄 |
Unfortunately, if you want to use the The code below should go inside a new file new class extends ComponentFactory {
install(Component) {
super.install(class extends require('laravel-mix/src/components/' + Component.name) {
dependencies() {
return ((super.dependencies ? super.dependencies() : null) || [])
.filter(dependency => dependency != 'vue-template-compiler');
}
});
}
}().installAll(); It's not very pretty but at least it works, at least for EDIT: For some reason you cannot use EDIT 2: For the more paranoïd people, if you want to be sure to get your webpack.config.js up to date: const laravelMixVersion = require('./package-lock.json').dependencies['laravel-mix'].version;
const targetVersion = '4.1.4'; // Replace by your current version
if (laravelMixVersion !== targetVersion) {
throw new Error(`Please update your webpack.config.js accordingly to the new version of laravel-mix (https://laravel.com/docs/5.8/mix#custom-webpack-configuration). Current: ${laravelMixVersion}, target: ${targetVersion}`);
} |
Laravel-Mix is great, That's why I used it for another non-laravel project. But my non-laravel project doesn't need Vue, how to disable this when running |
@dendihandian Normally it should have been removed in version 6 as this comment shows #2339 (comment). So try to upgrade your version, otherwise you could try the hack given by the comment just before yours (working on version 4, can't say about other versions) EDIT : It has been remove in version 6, not 5. My bad. |
@paullaffitte I think it still there. |
Yeah, looks like this still is the case with "laravel-mix": "^5.0.1" .. the first time you run |
Sorry I meant version 6 actually, I just edited my answer. PS : Version 6 is currently in beta 😕 |
Here is another approach for non Vue projects. Add below lines in mix.override(function (webpackConfig) {
webpackConfig.plugins = webpackConfig.plugins.filter(plugin => plugin.constructor.name !== 'VueLoaderPlugin');
return webpackConfig;
}) |
node -v
): v11.4.0npm -v
): 6.4.1Description:
I suspect starting in 4.0.10 with the introduction to this commit,
vue-template-compiler
appears to be installing despite the project not using Vue nor having any reference to it whatsoever.The text was updated successfully, but these errors were encountered: