-
Notifications
You must be signed in to change notification settings - Fork 27
Error when building with webpack 2 on linux #4
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
Comments
adding this to webpack.conf.js resolves the problem. This should be in documentation. |
I created a test project using: mkdir vueAutonum && cd vueAutonum
npm init # say yes to all
yarn add autonumeric vue-autonumeric webpack@2 ...to compile vue-autonumeric with the old webpack version 2 with the files:
import VueAutonumeric from '../node_modules/vue-autonumeric/dist/vue-autonumeric.min.js';
console.log(VueAutonumeric);
module.exports = {
entry : "src/vueAutonumericTest.js",
output: {
filename: "dist/bundle.js"
},
resolve: {
alias: {
AutoNumeric: 'node_modules/autonumeric/dist/autoNumeric.min',
},
},
}; Now, when I run
How did you fix that exactly? Note: the current version of vue-autonumeric already has the correct alias in |
I have no idea how webpack works, lol. and it works. Dont know why alias in vue-autonumeric's webpack.base.js not being used and\or working. |
I think there has two ways to fix this issue: 1. Do not use 2. Keep the |
Removing the I'll try your second suggestions and use |
Ok so I modified the AutoNumeric dependency to a |
I'm sorry to suggest add I had created a pr and try to solve the problem: #5 I am not sure why you want to use |
Fix issue #4 Error when building with webpack 2 on linux
Thank you for the fix @SamHwang1990! |
However, I think you had made something wrong in new commit a4a27ab. 1. externals: {
// This prevent bundling the AutoNumeric library inside the vue-autonumeric component
// cf. https://webpack.js.org/configuration/externals/
AutoNumeric: 'autonumeric'
} 2. With webpack, User no need to install More details, npm will install the |
Yes, this is fixed (for real this time) in |
Fix the autonumeric external config 1. depend `autonumeric` as `autonumeric` in amd or commonjs environment. 2. depend `autonumeric` as `AutoNumeric` in global script environment.
Building with webpack hrows an error:
Module not found: Error: Can't resolve 'AutoNumeric' in /VERY_LONG_PATH_TO_MY_PROJECT_DIR/node_modules/vue-autonumeric/dist'
and problem is, your package tries to import
AutoNumeric
, but actual directory name isautonumeric
, in lowercase.ln -s from
AutoNumeric
toautonumeric
in my node_modules resolves the issue.The text was updated successfully, but these errors were encountered: