Skip to content

Problem when importing vue-autonumeric, but not when importing AutoNumeric #25

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
j-a-m-l opened this issue Oct 4, 2018 · 6 comments
Closed

Comments

@j-a-m-l
Copy link

j-a-m-l commented Oct 4, 2018

I'm trying to use vue-autonumeric on an Electron app (on Linux).

I can import autonumeric alone

import AutoNumeric from 'AutoNumeric'

using an alias:

resolve: {
  alias: {
    'AutoNumeric': 'numeric'
  }
}

but if I try to import vue-autonumeric I see the error Cannot find module 'AutoNumeric'

import VueAutonumeric from 'vue-autonumeric'

using an alias:

resolve: {
  alias: {
     'AutoNumeric': 'numeric',
    // Or these other aliases
    // 'AutoNumeric': 'node_modules/autonumeric/dist/autoNumeric.min',
    // 'AutoNumeric': path.join(__dirname, '../node_modules/autonumeric/dist/autoNumeric.min'),
  }
}
@AlexandreBonneau
Copy link
Member

Hi, this is the intended behavior as pointed out in the doc:

Note: In order to minimize the size of the vue-autoNumeric component, the AutoNumeric library dependency is not bundled with it.

We let the dev uses whatever AutoNumeric version he wishes, which indeed means you'll have to import it one way or another, either using a CDN, or installing it via npm beforehand.

Have you tried this configuration?:

resolve: {
    alias: {
        AutoNumeric: 'node_modules/autonumeric/dist/autoNumeric.min',
    },
},

@j-a-m-l
Copy link
Author

j-a-m-l commented Oct 13, 2018

Yes, I tried it, but it wasn't able to find the module.

Since I finally decide to make a DIY solution (an input that, when isn't focused, use a different library to format the numeric content) and it's working fine, the issue could be closed.

Anyway, I appreciate your reply.

@j-a-m-l j-a-m-l closed this as completed Oct 13, 2018
@AlexandreBonneau
Copy link
Member

I'm sorry to hear you had to rely on hacks :( I really am.
Feel free to mention me next time if I take time to answer.

@j-a-m-l
Copy link
Author

j-a-m-l commented Oct 17, 2018

Well, isn't really a hack, but an "alternative implementation" ;-). In fact, it has something that I miss from this library: the ability to use locale codes, like en-GB, es-ES, etc.

@AlexandreBonneau
Copy link
Member

@j-a-m-l this is interesting, would you please elaborate in a feature request in the AutoNumeric issue tracker?

@j-a-m-l
Copy link
Author

j-a-m-l commented Oct 18, 2018

Done: autoNumeric/autoNumeric#614

agentschmitt added a commit to SamhammerAG/vue-autoNumeric that referenced this issue Feb 5, 2020
a65162 added a commit to a65162/vue-autoNumeric that referenced this issue Jul 6, 2020
Fixes autoNumeric#29, autoNumeric#25 remove requirement of webpack alias for autonumeric de…
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

2 participants