-
Notifications
You must be signed in to change notification settings - Fork 917
Closed
Labels
Description
Version
15.8.3
Reproduction link
https://github.com/Lyrkan/repro-vue-loader-webpack5
Steps to reproduce
- Create a basic project using the latest version of
vue-loaderand Webpack 5 with the three following rules :
{ test: /\.js$/, use: [ { loader: 'babel-loader', options: {} } ] }{ test: /\.css$/, use: [ { loader: 'css-loader', options: { url: true } } ] }(urlcan be replaced by any option that exists incss-loaderbut not inbabel-loader){ test: /\.vue$/, loader: 'vue-loader' }
-
Import a
.vuefile that contains a<script>tag -
Try to compile the project
What is expected?
Should compile fine
What is actually happening?
The build fails because the url option meant for the css-loader is passed to the babel-loader:
ERROR in ./src/App.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ruleSet[0].rules[0].use[0]!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&)
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: Unknown option: .url. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
It does not happen when using Webpack 4
It does not happen either when not using Rule.use or when options is not specified in the babel-loader rule.
lovetingyuan, ryanelian and hilongjw