Open yiliang114 opened 4 years ago
Sorry but I cannot reproduce this issue. Please provide a "minimal" reproduce repo
@meteorlxy I temporarily created a minimal reconstruction project link . You can just git clone it , then run npm install
and npm start
. when you open http://localhost:8080
, you can see a simple resume which like the following picture1.
But In fact, normal performance is like picture2.
After my screening the code, the only difference is the "main" field in package.json. I found only setting the "main" field "index.js" instead of "layouts/Layout.vue" (or other js file pathname) can make styles normally. But the official documentation said it could be "layouts/Layout.vue", I doubt that vuepress can not import styles/index.styl
file automatically.
Confirmed. That's an issue about resolving theme path.
Well, I personally decline 'layouts/Layout.vue'
way, as it's mainly for compatibility with 0.x themes. That might be dropped in the future
Figured out the reason. This issue was caused by #1564, which did not fix the corresponding issue correctly.
Bug report
Steps to reproduce
you can see the package.json for my theme, if i just
yarn start
in local , maybe the package.json is not necessary. Thetheme/index.js
in my theme is almost empty. And only do that as shown above, my theme can only to load index.styl automatically.if i remove
theme/index.js
and set the "main" field to layouts/Layout.vue in package.json from the reference , after i runnpm publish
and install the latest theme, the style can not be load in the page.What is expected?
set the "main" field to layouts/Layout.vue in package.json from the reference and publish my theme, people who installed the latest theme can load style correctly
What is actually happening?
theme may lose some style , due to the index.styl could not load automatically
Other relevant information
npx vuepress info
in my VuePress project:Environment Info:
System: OS: macOS Mojave 10.14.6 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Binaries: Node: 10.15.2 - /usr/local/bin/node Yarn: 1.22.0 - ~/.yarn/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Browsers: Chrome: 80.0.3987.100 Firefox: 71.0 Safari: 13.0.4 npmPackages: @vuepress/core: 1.3.0 @vuepress/theme-default: 1.3.0 vuepress: ^1.2.0 => 1.3.0 npmGlobalPackages: vuepress: 1.2.0