Closed nikhilkul closed 6 years ago
Duplicate of #451, please step over there to see the workaround.
@ulivz #451 says add code to lib/app/app.js
.
Does that mean I have to create a new .js
file somewhere? Tried docs/.vuepress/enhanceApp.js
as was mentioned in #443 , but it throws ReferenceError: window is not defined
Simply changing import DatePicker from 'vue2-datepicker';
to import DatePicker from '../../../node_modules/vue2-datepicker;
in the reproduction repository mentioned above does not solve the issue.
The library that I am trying to import, does not have a .vue
file at root path.
The folder structure looks like this,
node_modules/vue2-datepicker
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README.zh-CN.md
├── lib
│ ├── datepicker.css
│ ├── datepicker.js
│ └── index.js
├── package.json
└── src
├── calendar.vue
├── directives
│ └── clickoutside.js
├── index.js
├── index.scss
├── index.vue
├── locale
│ └── languages.js
├── mixins
│ └── locale.js
├── panel
│ ├── date.js
│ ├── month.js
│ ├── time.js
│ └── year.js
└── utils
├── index.js
└── scroll-into-view.js
I tried following:
import DatePicker from '../../../node_modules/vue2-datepicker/src/index.vue;
import DatePicker from '../../../node_modules/vue2-datepicker
Both didn't work.
@ulivz Can you please help me for this ⏫
Bug report
Version
0.12.0
Steps to reproduce
yarn install
yarn global add vuepress
yarn docs:build
-> Fails withWhat is expected?
yarn docs:build
should not fail ifyarn docs:dev
is not throwing any error.What is actually happening?
When I remove following imports, in
docs/.vuepress/components/product2.vue
the build works.Other relevant information