Open likemusic opened 3 years ago
According to Vue Loader docs:
The plugin is required! It is responsible for cloning any other rules you have defined and applying them to the corresponding language blocks in .vue files. For example, if you have a rule matching /\.js$/, it will be applied to <script> blocks in .vue files.
When used vue-inheritance-loader used with VueLoaderPlugin like this:
webpackConfig(webpackConfig) {
webpackConfig.module.rules.push({
test: /\.vue$/,
use: [
{
loader: 'vue-inheritance-loader',
options: Config.vue || {}
}
]
});
webpackConfig.plugins.push(new VueLoaderPlugin());
this.updateCssLoaders(webpackConfig);
}
I've got the error:
Error: [VueLoaderPlugin Error] No matching use for vue-loader is found.
Make sure the rule matching .vue files include vue-loader in its use.
Full log:
yarn run v1.22.4
$ npm run development
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1606516686175-0.9667967946627836/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @ development /var/www
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
/var/www/node_modules/webpack-cli/bin/cli.js:281
throw err;
^
Error: [VueLoaderPlugin Error] No matching use for vue-loader is found.
Make sure the rule matching .vue files include vue-loader in its use.
at VueLoaderPlugin.apply (/var/www/node_modules/vue-loader/lib/plugin-webpack4.js:59:13)
at webpack (/var/www/node_modules/webpack/lib/webpack.js:51:13)
at processOptions (/var/www/node_modules/webpack-cli/bin/cli.js:272:16)
at /var/www/node_modules/webpack-cli/bin/cli.js:364:3
at Object.parse (/var/www/node_modules/yargs/yargs.js:576:18)
at /var/www/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/var/www/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/var/www/node_modules/webpack/bin/webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-27T22_38_10_926Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Any ideas how to fix this?
Finally I have created my own loader - vue-template-extends - that not replaced the default vue-loader
.
When added to
webpack.mix.js
(according to #4 ):this error happens:
As I understand, this is because standard vue-loader still used. Threrefore I have tried to replace in
node_modules/laravel-mix/src/components/Vue.js
this:with that:
I've got many errors like this:
Any ideas how to fix? Does anyone use this package with laravel mix?