Skip to content

vue-loader 14.1.0 ignores transformToRequire config #1171

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

Closed
andreyrd opened this issue Feb 21, 2018 · 2 comments
Closed

vue-loader 14.1.0 ignores transformToRequire config #1171

andreyrd opened this issue Feb 21, 2018 · 2 comments

Comments

@andreyrd
Copy link

Version

14.1.0

Reproduction link

https://github.com/andreyrd/vue-loader-transformtorequire-demo

Steps to reproduce

  1. Clone the repo.
  2. Run yarn install to install the project with vue-loader: 14.0.0.
  3. Run yarn dev and note that there are two Vue logos showing up, one after the other.
  4. Stop the server.
  5. Edit the package.json and update vue-loader to 14.1.0.
  6. Run yarn install to install vue-loader: 14.1.0.
  7. Run yarn dev and note that the second Vue logo no longer shows up.

What is expected?

The second image should be showing up.
The second image is a custom component that relies on the transformToRequire config to have Test: 'source' in order to transform it's source prop into a require() statement.

See build/vue-loader.conf.js for the config I'm talking about.

What is actually happening?

Since 14.1.0, vue-loader is ignoring the transformToRequire property in the config.


I believe the bug was introduced here: 289b4d9#diff-7c7d4918b118d27d18538f53b8155e88L138

@andreyrd andreyrd changed the title vue-loader 14.1.0 starts ignoring transformToRequire config vue-loader 14.1.0 ignores transformToRequire config Feb 21, 2018
@oliverzy
Copy link

oliverzy commented Mar 5, 2018

yes, today I also found this issue after upgrading vue-loader.
It can be fixed by changing https://github.com/vuejs/vue-loader/blob/master/lib/template-compiler/index.js#L17 to

const defaultModules = [transformRequire(vueOptions.transformToRequire), transformSrcset()]

@yyx990803
Copy link
Member

Fixed via #1175

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