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

Enforces require.resolve for loaders #4532

Merged
merged 14 commits into from
Nov 4, 2019
Prev Previous commit
Next Next commit
style(cli): fix the linting
  • Loading branch information
arcanis committed Sep 2, 2019
commit ceab89b902869306ac7ab5ee21cf86939cce4591
3 changes: 2 additions & 1 deletion packages/@vue/cli-plugin-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ module.exports = (api, projectOptions) => {
if (api.hasPlugin('babel')) {
addLoader({
// TODO: I guess the intent is to require the `babel-loader` provided by the Babel vue
// plugin, but that means we now rely on the hoisting. It should instead we queried
// plugin, but that means we now rely on the hoisting. It should instead be queried
// against the plugin itself, or through a peer dependency.
// eslint-disable-next-line node/no-extraneous-require
loader: require.resolve('babel-loader')
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/config/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module.exports = (api, rootOptions) => {
}

if (loader) {
let resolvedLoader;
let resolvedLoader
try {
resolvedLoader = require.resolve(loader)
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"thread-loader": "^2.1.2",
"url-loader": "^2.1.0",
"vue-loader": "^15.7.0",
"vue-style-loader": "^4.1.0",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-chain": "^6.0.0",
Expand Down